diff options
Diffstat (limited to 'win32/ipmem.c')
-rw-r--r-- | win32/ipmem.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/win32/ipmem.c b/win32/ipmem.c new file mode 100644 index 0000000000..62e72ab8db --- /dev/null +++ b/win32/ipmem.c @@ -0,0 +1,39 @@ +/* + + ipmem.c + Interface for perl memory allocation + +*/ + +#include <ipmem.h> + +class CPerlMem : public IPerlMem +{ +public: + CPerlMem() { pPerl = NULL; }; + virtual void* Malloc(size_t); + virtual void* Realloc(void*, size_t); + virtual void Free(void*); + + inline void SetPerlObj(CPerlObj *p) { pPerl = p; }; +protected: + CPerlObj *pPerl; +}; + +void* CPerlMem::Malloc(size_t size) +{ + return malloc(size); +} + +void* CPerlMem::Realloc(void* ptr, size_t size) +{ + return realloc(ptr, size); +} + +void CPerlMem::Free(void* ptr) +{ + free(ptr); +} + + + |