You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
645 B
43 lines
645 B
#include "pch.h"
|
|
#pragma hdrstop
|
|
|
|
#include "alloc.h"
|
|
#include "except.h"
|
|
|
|
|
|
void * __cdecl operator new(
|
|
size_t size
|
|
)
|
|
{
|
|
void *pv = LocalAlloc(LMEM_FIXED, size);
|
|
if (NULL == pv)
|
|
throw CAllocException();
|
|
|
|
return pv;
|
|
}
|
|
|
|
void* __cdecl operator new[] (size_t size)
|
|
{
|
|
void *pv = LocalAlloc(LMEM_FIXED, size);
|
|
if (NULL == pv)
|
|
throw CAllocException();
|
|
|
|
return pv;
|
|
}
|
|
|
|
|
|
void __cdecl operator delete(
|
|
void *ptr
|
|
)
|
|
{
|
|
if (NULL != ptr)
|
|
LocalFree(ptr);
|
|
}
|
|
|
|
|
|
void __cdecl operator delete[] (void* ptr)
|
|
{
|
|
if (NULL != ptr)
|
|
LocalFree(ptr);
|
|
}
|
|
|