Mercurial > ~dholland > hg > ag > index.cgi
comparison anagram/ag1/cppalloc.cpp @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children | 7661c1604e49 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13d2b8934445 |
---|---|
1 #include <stddef.h> | |
2 #include "port.h" | |
3 | |
4 #include "myalloc.h" | |
5 | |
6 /* | |
7 * With the IBM compiler these apparently may not be in a .lib file. | |
8 */ | |
9 | |
10 void *operator new(size_t size) { | |
11 //newCalls++; | |
12 void *pointer = myalloc(size); | |
13 return pointer; | |
14 } | |
15 | |
16 void operator delete(void *p) { | |
17 //deleteCalls++; | |
18 DEALLOCATE(p); | |
19 } | |
20 | |
21 void *operator new[](size_t size) { | |
22 //newArrayCalls++; | |
23 void *pointer = myalloc(size); | |
24 return pointer; | |
25 } | |
26 | |
27 void operator delete[](void *p) { | |
28 //deleteArrayCalls++; | |
29 DEALLOCATE(p); | |
30 } |