summaryrefslogtreecommitdiff
path: root/win/inspircd_memory_functions.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-19 16:01:06 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-19 16:01:06 +0000
commitc778d1258a3d778d0a6227b632ba5091a0eb25a0 (patch)
tree8dcd6b8e86c093784db55498b99a6a7441d91787 /win/inspircd_memory_functions.cpp
parent9cf56d917d92959701694477f7944d45ad2c38ed (diff)
Helps if I add the w32 specific code, too. :p
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7044 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'win/inspircd_memory_functions.cpp')
-rw-r--r--win/inspircd_memory_functions.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/win/inspircd_memory_functions.cpp b/win/inspircd_memory_functions.cpp
new file mode 100644
index 000000000..d03330bf5
--- /dev/null
+++ b/win/inspircd_memory_functions.cpp
@@ -0,0 +1,12 @@
+// Use the global heap for this process for all allocate/free operations.
+#include "inspircd_win32wrapper.h"
+
+void * ::operator new(size_t iSize)
+{
+ return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iSize); // zero memory for unix compatibility
+}
+
+void ::operator delete(void * ptr)
+{
+ HeapFree(GetProcessHeap(), 0, ptr);
+}