aboutsummaryrefslogtreecommitdiff
path: root/mm.h
diff options
context:
space:
mode:
authorWaldemar Celes <celes@tecgraf.puc-rio.br>1994-03-28 12:14:02 -0300
committerWaldemar Celes <celes@tecgraf.puc-rio.br>1994-03-28 12:14:02 -0300
commit3577eb6f136bf2b394c2ce839fc098da5faa9fd5 (patch)
treeb9a60ccf33e4da721dbad5f24a7d4701fc4af49b /mm.h
parent7f3d01c200df33b67d1f4b0198adae7ea7af8e10 (diff)
downloadlua-3577eb6f136bf2b394c2ce839fc098da5faa9fd5.tar.gz
lua-3577eb6f136bf2b394c2ce839fc098da5faa9fd5.tar.bz2
lua-3577eb6f136bf2b394c2ce839fc098da5faa9fd5.zip
Acrescentar o include do gerenciador de memoria "mm".
Diffstat (limited to 'mm.h')
-rw-r--r--mm.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/mm.h b/mm.h
new file mode 100644
index 00000000..40fdf84d
--- /dev/null
+++ b/mm.h
@@ -0,0 +1,39 @@
1/*
2** mm.h
3** Waldemar Celes Filho
4** Sep 16, 1992
5*/
6
7
8#ifndef mm_h
9#define mm_h
10
11#include <stdlib.h>
12
13#ifdef _MM_
14
15/* switch off the debugger functions */
16#define malloc(s) MmMalloc(s,__FILE__,__LINE__)
17#define calloc(n,s) MmCalloc(n,s,__FILE__,__LINE__)
18#define realloc(a,s) MmRealloc(a,s,__FILE__,__LINE__,#a)
19#define free(a) MmFree(a,__FILE__,__LINE__,#a)
20#define strdup(s) MmStrdup(s,__FILE__,__LINE__)
21#endif
22
23typedef void (*Ferror) (char *);
24
25/* Exported functions */
26void MmInit (Ferror f, Ferror w);
27void *MmMalloc (unsigned size, char *file, int line);
28void *MmCalloc (unsigned n, unsigned size, char *file, int line);
29void MmFree (void *a, char *file, int line, char *var);
30void *MmRealloc (void *old, unsigned size, char *file, int line, char *var);
31char *MmStrdup (char *s, char *file, int line);
32unsigned MmGetBytes (void);
33void MmListAllocated (void);
34void MmCheck (void);
35void MmStatistics (void);
36
37
38#endif
39