Acrescentar o include do gerenciador de memoria "mm".

This commit is contained in:
Waldemar Celes
1994-03-28 12:14:02 -03:00
parent 7f3d01c200
commit 3577eb6f13
5 changed files with 51 additions and 4 deletions

39
mm.h Normal file
View File

@@ -0,0 +1,39 @@
/*
** mm.h
** Waldemar Celes Filho
** Sep 16, 1992
*/
#ifndef mm_h
#define mm_h
#include <stdlib.h>
#ifdef _MM_
/* switch off the debugger functions */
#define malloc(s) MmMalloc(s,__FILE__,__LINE__)
#define calloc(n,s) MmCalloc(n,s,__FILE__,__LINE__)
#define realloc(a,s) MmRealloc(a,s,__FILE__,__LINE__,#a)
#define free(a) MmFree(a,__FILE__,__LINE__,#a)
#define strdup(s) MmStrdup(s,__FILE__,__LINE__)
#endif
typedef void (*Ferror) (char *);
/* Exported functions */
void MmInit (Ferror f, Ferror w);
void *MmMalloc (unsigned size, char *file, int line);
void *MmCalloc (unsigned n, unsigned size, char *file, int line);
void MmFree (void *a, char *file, int line, char *var);
void *MmRealloc (void *old, unsigned size, char *file, int line, char *var);
char *MmStrdup (char *s, char *file, int line);
unsigned MmGetBytes (void);
void MmListAllocated (void);
void MmCheck (void);
void MmStatistics (void);
#endif