summaryrefslogtreecommitdiff
path: root/mm.h
blob: 40fdf84d1f6a5adc5ccc6b76f5337478f669734f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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