aboutsummaryrefslogtreecommitdiff
path: root/ltests.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-10-02 17:31:17 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-10-02 17:31:17 -0300
commitb97fb932ece7872a8d1dd6c0a2c88f3ce33e9741 (patch)
treed9e60044a35ad3fdf761f28506be08205081ebd7 /ltests.h
parentc7cf92e6f318823406e40ad6016e5ccb4e041c72 (diff)
downloadlua-b97fb932ece7872a8d1dd6c0a2c88f3ce33e9741.tar.gz
lua-b97fb932ece7872a8d1dd6c0a2c88f3ce33e9741.tar.bz2
lua-b97fb932ece7872a8d1dd6c0a2c88f3ce33e9741.zip
Lua kernel does not use malloc/free functions.
Diffstat (limited to 'ltests.h')
-rw-r--r--ltests.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/ltests.h b/ltests.h
index 44242781..0eb64bcf 100644
--- a/ltests.h
+++ b/ltests.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.h,v 1.19 2002/11/19 17:42:32 roberto Exp roberto $ 2** $Id: ltests.h,v 1.20 2002/12/04 17:29:05 roberto Exp roberto $
3** Internal Header for Debugging of the Lua Implementation 3** Internal Header for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -27,16 +27,20 @@
27 27
28 28
29/* memory allocator control variables */ 29/* memory allocator control variables */
30extern unsigned long memdebug_numblocks; 30typedef struct Memcontrol {
31extern unsigned long memdebug_total; 31 unsigned long numblocks;
32extern unsigned long memdebug_maxmem; 32 unsigned long total;
33extern unsigned long memdebug_memlimit; 33 unsigned long maxmem;
34 unsigned long memlimit;
35} Memcontrol;
34 36
37extern Memcontrol memcontrol;
35 38
36#define l_realloc(b, os, s) debug_realloc(b, os, s) 39void *debug_realloc (void *ud, void *block, size_t osize, size_t nsize);
37#define l_free(b, os) debug_realloc(b, os, 0)
38 40
39void *debug_realloc (void *block, size_t oldsize, size_t size); 41#ifdef lua_c
42#define luaL_newstate() lua_newstate(debug_realloc, &memcontrol)
43#endif
40 44
41 45
42 46