Browse Source

Acrescentar o include do gerenciador de memoria "mm".

Waldemar Celes 31 years ago
parent
commit
3577eb6f13
5 changed files with 51 additions and 4 deletions
  1. 3 1
      hash.c
  2. 3 1
      iolib.c
  3. 39 0
      mm.h
  4. 3 1
      opcode.c
  5. 3 1
      strlib.c

+ 3 - 1
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"

+ 3 - 1
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;

+ 39 - 0
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
+

+ 3 - 1
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"

+ 3 - 1
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"