00001 #ifndef ALLOC_H
00002 #define ALLOC_H
00003
00004 #if defined(_WIN32) && defined(_MEM_DEBUG)
00005 void *c_alloc(unsigned long size, unsigned long num, const char *file, unsigned long line);
00006 void *m_alloc(unsigned long size, const char *file, unsigned long line);
00007 void f_ree(void *ptr);
00008
00009 #ifdef malloc
00010 #undef malloc
00011 #endif
00012
00013 #ifdef calloc
00014 #undef calloc
00015 #endif
00016
00017 #ifdef free
00018 #undef free
00019 #endif
00020
00021
00022 #define malloc(size) m_alloc(size, __FILE__, __LINE__)
00023 #define calloc(size, num) c_alloc(size, num, __FILE__, __LINE__)
00024 #define free(addr) f_ree(addr)
00025 #endif//defined(_WIN32) && defined(_MEM_DEBUG)
00026
00027 #endif//ALLOC_H