commit 00c122cc291cfb24e01a5c00f2c3503a6dfa073e
parent 03160920cf51a06bbb4406ec5ddb4f5dd52f0d7c
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 1 Dec 1997 18:30:23 -0200
other distribution of memory debug information.
Diffstat:
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/lbuiltin.c b/lbuiltin.c
@@ -1,5 +1,5 @@
/*
-** $Id: lbuiltin.c,v 1.12 1997/11/27 18:25:14 roberto Exp roberto $
+** $Id: lbuiltin.c,v 1.13 1997/11/28 12:39:45 roberto Exp roberto $
** Built-in functions
** See Copyright Notice in lua.h
*/
@@ -373,6 +373,13 @@ static void luaI_collectgarbage (void)
*/
#ifdef DEBUG
+static void mem_query (void)
+{
+ lua_pushnumber(totalmem);
+ lua_pushnumber(numblocks);
+}
+
+
static void testC (void)
{
#define getnum(s) ((*s++) - '0')
@@ -433,7 +440,7 @@ static struct luaL_reg int_funcs[] = {
#endif
#ifdef DEBUG
{"testC", testC},
- {"totalmem", luaM_query},
+ {"totalmem", mem_query},
#endif
{"assert", luaI_assert},
{"call", luaI_call},
diff --git a/lmem.c b/lmem.c
@@ -1,5 +1,5 @@
/*
-** $Id: lmem.c,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $
+** $Id: lmem.c,v 1.2 1997/11/19 17:29:23 roberto Exp roberto $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@@ -80,16 +80,8 @@ void *luaM_realloc (void *block, unsigned long size)
#define MARK 55
-static unsigned long numblocks = 0;
-static unsigned long totalmem = 0;
-
-
-
-void luaM_query (void)
-{
- lua_pushnumber(totalmem);
- lua_pushnumber(numblocks);
-}
+unsigned long numblocks = 0;
+unsigned long totalmem = 0;
static void *checkblock (void *block)
diff --git a/lmem.h b/lmem.h
@@ -1,5 +1,5 @@
/*
-** $Id: lmem.h,v 1.2 1997/11/26 18:53:45 roberto Exp roberto $
+** $Id: lmem.h,v 1.3 1997/11/26 20:44:52 roberto Exp roberto $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@@ -36,7 +36,8 @@ int luaM_growaux (void **block, unsigned long nelems, int size,
#ifdef DEBUG
-void luaM_query (void);
+extern unsigned long numblocks;
+extern unsigned long totalmem;
#endif