1 //========================================================================
2 //
3 // gmempp.cc
4 //
5 // Use gmalloc/gfree for C++ new/delete operators.
6 //
7 // Copyright 1996-2003 Glyph & Cog, LLC
8 //
9 //========================================================================
10 
11 #include <config.h>
12 #include "gmem.h"
13 
14 #ifdef DEBUG_MEM
15 
operator new(size_t size)16 void *operator new(size_t size) {
17   return gmalloc((int)size);
18 }
19 
operator new[](size_t size)20 void *operator new[](size_t size) {
21   return gmalloc((int)size);
22 }
23 
operator delete(void * p)24 void operator delete(void *p) {
25   gfree(p);
26 }
27 
operator delete[](void * p)28 void operator delete[](void *p) {
29   gfree(p);
30 }
31 
32 #endif
33