aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-06-05 17:07:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-06-05 17:07:53 -0300
commitc542aac0b935a65203244c130cdfa700113f0bc8 (patch)
tree83719377490646a17c31ceb3cabb3111b713151a /lgc.c
parentdbfb810267d8fd7ecf546ea1e1edc8892547e664 (diff)
downloadlua-c542aac0b935a65203244c130cdfa700113f0bc8.tar.gz
lua-c542aac0b935a65203244c130cdfa700113f0bc8.tar.bz2
lua-c542aac0b935a65203244c130cdfa700113f0bc8.zip
collect dead indices in tables
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lgc.c b/lgc.c
index b8cbc54f..f1296cde 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.53 2000/05/30 19:00:31 roberto Exp roberto $ 2** $Id: lgc.c,v 1.54 2000/06/05 14:56:18 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -64,6 +64,8 @@ static void tablemark (lua_State *L, Hash *h) {
64 for (i=h->size-1; i>=0; i--) { 64 for (i=h->size-1; i>=0; i--) {
65 Node *n = node(h,i); 65 Node *n = node(h,i);
66 if (ttype(key(n)) != TAG_NIL) { 66 if (ttype(key(n)) != TAG_NIL) {
67 if (ttype(val(n)) == TAG_NIL)
68 luaH_remove(h, key(n)); /* dead element; try to remove it */
67 markobject(L, &n->key); 69 markobject(L, &n->key);
68 markobject(L, &n->val); 70 markobject(L, &n->val);
69 } 71 }