|
void * operator new( size_t cb )
{
void *res = _nh_malloc( cb, 1 );
RTCCALLBACK(_RTC_Allocate_hook, (res, cb, 0));
return res;
}
void * __cdecl _malloc_base (size_t size)
{
void *res = _nh_malloc_base(size, _newmode);
RTCCALLBACK(_RTC_Allocate_hook, (res, size, 0));
return res;
}
new와 malloc은 코드는 Win32s에서 이와 같이 비슷하구요.
new는 컴파일러 레벨에서 생성자를 호출하는 부분이 추가됩니다.
그래서 생성자 호출이 필요없는 malloc이 더 빠르죠.
기럼 ^^
|