From dad808a73a98a23729614b8814728d76b4e5d577 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 29 Sep 2000 09:42:13 -0300 Subject: new way to count `nblocks' for GC (try to count bytes). --- ltm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index ca4ea88d..fd854d66 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 1.48 2000/09/11 19:45:27 roberto Exp roberto $ +** $Id: ltm.c,v 1.49 2000/09/11 20:29:27 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -77,6 +77,7 @@ static void init_entry (lua_State *L, int tag) { void luaT_init (lua_State *L) { int t; luaM_growvector(L, L->IMtable, 0, NUM_TAGS, struct IM, "", MAX_INT); + L->nblocks += NUM_TAGS*sizeof(struct IM); L->last_tag = NUM_TAGS-1; for (t=0; t<=L->last_tag; t++) init_entry(L, t); @@ -86,6 +87,7 @@ void luaT_init (lua_State *L) { int lua_newtag (lua_State *L) { luaM_growvector(L, L->IMtable, L->last_tag, 1, struct IM, "tag table overflow", MAX_INT); + L->nblocks += sizeof(struct IM); L->last_tag++; init_entry(L, L->last_tag); return L->last_tag; -- cgit v1.2.3-55-g6feb