CloverBootloader/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp
Sergey Isakov 86cb372de2 add missing files
Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
2020-02-15 17:51:18 +03:00

26 lines
387 B
C++

#include <Platform/Platform.h>
#if 0
#define DBG(...) DebugLog(2, __VA_ARGS__)
#else
#define DBG(...)
#endif
void* operator new ( unsigned long count )
{
void* ptr = AllocatePool(count);
if ( !ptr ) {
DebugLog(2, "AllocatePool(%d) returned NULL. Cpu halted\n", count);
CpuDeadLoop();
}
return ptr;
}
void operator delete ( void* ptr ) noexcept
{
return FreePool(ptr);
}