Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifdef _WIN32
00015
00016 #include <windows.h>
00017 #include <exception>
00018 #include <new>
00019 #include <new.h>
00020
00031 void *::operator new(size_t iSize)
00032 {
00033 void *ptr = HeapAlloc(GetProcessHeap(), 0, iSize);
00034
00035
00036
00037 if (!ptr)
00038 throw std::bad_alloc();
00039 else
00040 return ptr;
00041 }
00042
00043 void ::operator delete(void *ptr)
00044 {
00045 if (ptr)
00046 HeapFree(GetProcessHeap(), 0, ptr);
00047 }
00048
00049 void *operator new[](size_t iSize)
00050 {
00051 void *ptr = HeapAlloc(GetProcessHeap(), 0, iSize);
00052 if (!ptr)
00053 throw std::bad_alloc();
00054 else
00055 return ptr;
00056 }
00057
00058 void operator delete[](void *ptr)
00059 {
00060 if (ptr)
00061 HeapFree(GetProcessHeap(), 0, ptr);
00062 }
00063
00064 #endif