summaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-09-29 09:42:13 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-09-29 09:42:13 -0300
commitdad808a73a98a23729614b8814728d76b4e5d577 (patch)
tree945fabce1906c5f08fe6512476d7ca3d84017bca /ltm.c
parentca7fd50a4ec2f1b41292f859ba0d5e52a2b22a5c (diff)
downloadlua-dad808a73a98a23729614b8814728d76b4e5d577.tar.gz
lua-dad808a73a98a23729614b8814728d76b4e5d577.tar.bz2
lua-dad808a73a98a23729614b8814728d76b4e5d577.zip
new way to count `nblocks' for GC (try to count bytes).
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ltm.c b/ltm.c
index ca4ea88d..fd854d66 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 1.48 2000/09/11 19:45:27 roberto Exp roberto $ 2** $Id: ltm.c,v 1.49 2000/09/11 20:29:27 roberto Exp roberto $
3** Tag methods 3** Tag methods
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -77,6 +77,7 @@ static void init_entry (lua_State *L, int tag) {
77void luaT_init (lua_State *L) { 77void luaT_init (lua_State *L) {
78 int t; 78 int t;
79 luaM_growvector(L, L->IMtable, 0, NUM_TAGS, struct IM, "", MAX_INT); 79 luaM_growvector(L, L->IMtable, 0, NUM_TAGS, struct IM, "", MAX_INT);
80 L->nblocks += NUM_TAGS*sizeof(struct IM);
80 L->last_tag = NUM_TAGS-1; 81 L->last_tag = NUM_TAGS-1;
81 for (t=0; t<=L->last_tag; t++) 82 for (t=0; t<=L->last_tag; t++)
82 init_entry(L, t); 83 init_entry(L, t);
@@ -86,6 +87,7 @@ void luaT_init (lua_State *L) {
86int lua_newtag (lua_State *L) { 87int lua_newtag (lua_State *L) {
87 luaM_growvector(L, L->IMtable, L->last_tag, 1, struct IM, 88 luaM_growvector(L, L->IMtable, L->last_tag, 1, struct IM,
88 "tag table overflow", MAX_INT); 89 "tag table overflow", MAX_INT);
90 L->nblocks += sizeof(struct IM);
89 L->last_tag++; 91 L->last_tag++;
90 init_entry(L, L->last_tag); 92 init_entry(L, L->last_tag);
91 return L->last_tag; 93 return L->last_tag;