00001 00015 #ifndef _MEM_ALLOC_H 00016 #define _MEM_ALLOC_H 00017 00018 #include <stdio.h> 00019 #include <stdlib.h> 00020 #include <memory.h> 00021 #include <malloc.h> 00022 #include <assert.h> 00023 #include <sys/types.h> 00024 00025 // XXX MOVE TO TOPLEVEL CONFIG.H 00026 //SAFE_MEM pads memory, define this to zero if you dont want it 00027 #define SAFE_MEM 5 00028 00029 template<class T> 00030 T *agent_malloc(T **arg, size_t size); 00031 template<class T> 00032 T *agent_realloc(T **aa, size_t size); 00033 void agent_free(void *ptr); 00034 00035 #endif