commit 3577eb6f136bf2b394c2ce839fc098da5faa9fd5
parent 7f3d01c200df33b67d1f4b0198adae7ea7af8e10
Author: Waldemar Celes <celes@tecgraf.puc-rio.br>
Date: Mon, 28 Mar 1994 12:13:44 -0300
Acrescentar o include do gerenciador de memoria "mm".
Diffstat:
5 files changed, 51 insertions(+), 4 deletions(-)
diff --git a/hash.c b/hash.c
@@ -4,11 +4,13 @@
** Luiz Henrique de Figueiredo - 17 Aug 90
*/
-char *rcs_hash="$Id: $";
+char *rcs_hash="$Id: hash.c,v 1.1 1993/12/17 18:41:19 celes Exp celes $";
#include <string.h>
#include <stdlib.h>
+#include "mm.h"
+
#include "opcode.h"
#include "hash.h"
#include "inout.h"
diff --git a/iolib.c b/iolib.c
@@ -3,7 +3,7 @@
** Input/output library to LUA
*/
-char *rcs_iolib="$Id: iolib.c,v 1.1 1993/12/17 18:41:19 celes Exp roberto $";
+char *rcs_iolib="$Id: iolib.c,v 1.2 1993/12/30 14:52:18 roberto Exp celes $";
#include <stdlib.h>
#include <string.h>
@@ -14,6 +14,8 @@ char *rcs_iolib="$Id: iolib.c,v 1.1 1993/12/17 18:41:19 celes Exp roberto $";
#include <floatingpoint.h>
#endif
+#include "mm.h"
+
#include "lua.h"
static FILE *in=stdin, *out=stdout;
diff --git a/mm.h b/mm.h
@@ -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
+
diff --git a/opcode.c b/opcode.c
@@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio
*/
-char *rcs_opcode="$Id: opcode.c,v 1.1 1993/12/17 18:41:19 celes Exp roberto $";
+char *rcs_opcode="$Id: opcode.c,v 1.2 1994/02/13 20:36:51 roberto Exp celes $";
#include <stdio.h>
#include <stdlib.h>
@@ -12,6 +12,8 @@ char *rcs_opcode="$Id: opcode.c,v 1.1 1993/12/17 18:41:19 celes Exp roberto $";
#include <floatingpoint.h>
#endif
+#include "mm.h"
+
#include "opcode.h"
#include "hash.h"
#include "inout.h"
diff --git a/strlib.c b/strlib.c
@@ -3,12 +3,14 @@
** String library to LUA
*/
-char *rcs_strlib="$Id: $";
+char *rcs_strlib="$Id: strlib.c,v 1.1 1993/12/17 18:41:19 celes Exp celes $";
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include "mm.h"
+
#include "lua.h"