Cleanup code so it builds with C++ again
[ircu2.10.12-pk.git] / ircd / ircd_alloc.c
index c46bd987d6783a5f028ac1a0a0be813a22f1f5de..f77fc0f41a4e9d5b0d11325374dc470ceeafbc07 100644 (file)
@@ -28,6 +28,7 @@
 #include "s_debug.h"
 
 #include <assert.h>
+#include <string.h>
 
 static void nomem_handler(void);
 
@@ -51,3 +52,22 @@ set_nomem_handler(OutOfMemoryHandler handler)
 {
   noMemHandler = handler;
 }
+
+void* DoMalloc(size_t size, const char* x, const char* y, int z)
+{
+  void* t = malloc(size);
+  if (!t)
+    (*noMemHandler)();
+  return t;
+}
+
+void* DoMallocZero(size_t size, const char* x, const char* y, int z)
+{
+  void* t = malloc(size);
+  if (!t)
+    (*noMemHandler)();
+  memset(t, 0, size);
+  return t;
+}
+
+