From 0183b8030c80f57b87874ff7867ccdb172d9d3dc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 28 Dec 2000 10:55:41 -0200 Subject: `free' gets size of the block: complete control over memory use --- ltm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index 852dfd13..78cebeb2 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 1.57 2000/11/30 18:50:47 roberto Exp roberto $ +** $Id: ltm.c,v 1.58 2000/12/26 18:46:09 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -75,9 +75,8 @@ static void init_entry (lua_State *L, int tag) { void luaT_init (lua_State *L) { int t; + L->TMtable = luaM_newvector(L, NUM_TAGS+2, struct TM); L->sizeTM = NUM_TAGS+2; - L->TMtable = luaM_newvector(L, L->sizeTM, struct TM); - L->nblocks += NUM_TAGS*sizeof(struct TM); L->ntag = NUM_TAGS; for (t=0; tntag; t++) init_entry(L, t); @@ -87,7 +86,6 @@ void luaT_init (lua_State *L) { LUA_API int lua_newtag (lua_State *L) { luaM_growvector(L, L->TMtable, L->ntag, L->sizeTM, struct TM, MAX_INT, "tag table overflow"); - L->nblocks += sizeof(struct TM); init_entry(L, L->ntag); return L->ntag++; } -- cgit v1.2.3-55-g6feb