ilu_alloc.h 600 B

123456789101112131415161718192021222324252627
  1. #ifndef ALLOC_H
  2. #define ALLOC_H
  3. #if defined(_WIN32) && defined(_MEM_DEBUG)
  4. void *c_alloc(unsigned long size, unsigned long num, const char *file, unsigned long line);
  5. void *m_alloc(unsigned long size, const char *file, unsigned long line);
  6. void f_ree(void *ptr);
  7. #ifdef malloc
  8. #undef malloc
  9. #endif
  10. #ifdef calloc
  11. #undef calloc
  12. #endif
  13. #ifdef free
  14. #undef free
  15. #endif
  16. #define malloc(size) m_alloc(size, __FILE__, __LINE__)
  17. #define calloc(size, num) c_alloc(size, num, __FILE__, __LINE__)
  18. #define free(addr) f_ree(addr)
  19. #endif//defined(_WIN32) && defined(_MEM_DEBUG)
  20. #endif//ALLOC_H