3 #ifndef tools_glutess_memalloc
4 #define tools_glutess_memalloc
15 mem::increment(tools::s_malloc().c_str());
16 return ::malloc(a_size);
18 inline void*
mem_realloc(
void* a_ptr,
size_t a_size){
19 if(a_ptr==NULL) mem::increment(tools::s_malloc().c_str());
23 if(a_ptr!=NULL) mem::decrement(tools::s_malloc().c_str());
26 inline int mem_init(
size_t ) {
return 1;}
33 inline void*
mem_alloc(
size_t a_size) {return ::memset( ::malloc( a_size ), 0xa5, a_size);}
35 inline void mem_free(
void* a_ptr){::free(a_ptr);}
40 #define memAlloc tools::mem_alloc
41 #define memRealloc tools::mem_realloc
42 #define memFree tools::mem_free
43 #define memInit tools::mem_init