From: Brian Norris Date: Fri, 25 May 2012 00:23:38 +0000 (-0700) Subject: mymemory: use the right *&^% allocator!! X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=a0c3a67cdb4fc43dc08204662a50615174501217 mymemory: use the right *&^% allocator!! We're using MYMALLOC in the global new/delete instead of defaulting to snapshottable malloc, as planned. What a stupid bug. Also extend new/delete operators to be sure. --- diff --git a/mymemory.cc b/mymemory.cc index a825bb94..11542bfa 100644 --- a/mymemory.cc +++ b/mymemory.cc @@ -63,9 +63,17 @@ void free( void * ptr ){ } void * operator new(size_t size) throw(std::bad_alloc) { - return MYMALLOC(size); + return malloc(size); } void operator delete(void *p) throw() { - MYFREE(p); + free(p); +} + +void * operator new[](size_t size) throw(std::bad_alloc) { + return malloc(size); +} + +void operator delete[](void *p, size_t size) { + free(p); }