コード例 #1
0
ファイル: NewHandler.cpp プロジェクト: 9072997/wikireader
__cdecl 
#endif
operator new(size_t size)
{
  // void *p = ::HeapAlloc(::GetProcessHeap(), 0, size);
  void *p = ::malloc(size);
  if (p == 0)
    throw CNewException();
  return p;
}
コード例 #2
0
void * __cdecl operator new(size_t size)
{
    numAllocs++;
    void *p = HeapAlloc(GetProcessHeap(), 0, size);
    if (index < kDebugSize)
    {
        a[index] = p;
        index++;
    }
    if (p == 0)
        throw CNewException();
    printf("Alloc %6d, size = %8d\n", numAllocs, size);
    return p;
}