00001
00002
00003
00004
00005
00006
00007 #ifndef mm_h
00008 #define mm_h
00009
00010 #include <stdlib.h>
00011
00012 #ifdef _MM_
00013
00014
00015
00016 #define malloc(s) MmMalloc(s,__FILE__,__LINE__)
00017 #define calloc(n,s) MmCalloc(n,s,__FILE__,__LINE__)
00018 #define realloc(a,s) MmRealloc(a,s,__FILE__,__LINE__,#a)
00019 #define free(a) MmFree(a,__FILE__,__LINE__,#a)
00020 #define strdup(s) MmStrdup(s,__FILE__,__LINE__)
00021
00022 #endif
00023
00024 typedef void (*Ferror) (char *);
00025
00026
00027
00028 void MmInit ( Ferror f, Ferror w) ;
00029 void *MmMalloc ( unsigned size, char *file, int line );
00030 void *MmCalloc ( unsigned n, unsigned size, char *file, int line );
00031 void MmFree ( void *a, char *file, int line, char *var );
00032 void *MmRealloc( void *old, unsigned size, char *file, int line, char *var );
00033 char *MmStrdup ( char *s, char *file, int line );
00034 unsigned MmGetBytes ( void );
00035 void MmListAllocated( void) ;
00036 void MmCheck ( void );
00037 void MmStatistics ( void );
00038
00039 #endif
00040