mm.h 928 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. ** mm.h
  3. ** Waldemar Celes Filho
  4. ** Sep 16, 1992
  5. */
  6. #ifndef mm_h
  7. #define mm_h
  8. #include <stdlib.h>
  9. #ifdef _MM_
  10. /* switch off the debugger functions */
  11. #define malloc(s) MmMalloc(s,__FILE__,__LINE__)
  12. #define calloc(n,s) MmCalloc(n,s,__FILE__,__LINE__)
  13. #define realloc(a,s) MmRealloc(a,s,__FILE__,__LINE__,#a)
  14. #define free(a) MmFree(a,__FILE__,__LINE__,#a)
  15. #define strdup(s) MmStrdup(s,__FILE__,__LINE__)
  16. #endif
  17. typedef void (*Ferror) (char *);
  18. /* Exported functions */
  19. void MmInit (Ferror f, Ferror w);
  20. void *MmMalloc (unsigned size, char *file, int line);
  21. void *MmCalloc (unsigned n, unsigned size, char *file, int line);
  22. void MmFree (void *a, char *file, int line, char *var);
  23. void *MmRealloc (void *old, unsigned size, char *file, int line, char *var);
  24. char *MmStrdup (char *s, char *file, int line);
  25. unsigned MmGetBytes (void);
  26. void MmListAllocated (void);
  27. void MmCheck (void);
  28. void MmStatistics (void);
  29. #endif