aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-29 15:17:26 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-29 15:17:26 -0200
commit6b71a9cfe53040aa605f5d75c58a2124d03f8912 (patch)
treeadbd5eb607941b3fbf2eb36359b15841de4159ae /lgc.c
parentfa8c44b510c6b56a290c14bd5dba4c7caec53284 (diff)
downloadlua-6b71a9cfe53040aa605f5d75c58a2124d03f8912.tar.gz
lua-6b71a9cfe53040aa605f5d75c58a2124d03f8912.tar.bz2
lua-6b71a9cfe53040aa605f5d75c58a2124d03f8912.zip
smaller tables for machines with 8-bit alignment
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lgc.c b/lgc.c
index 67fee0e2..c6c85f18 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.80 2001/01/26 13:18:00 roberto Exp roberto $ 2** $Id: lgc.c,v 1.81 2001/01/26 14:16:24 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*/
@@ -133,11 +133,16 @@ static void traversetable (GCState *st, Hash *h) {
133 for (i=0; i<h->size; i++) { 133 for (i=0; i<h->size; i++) {
134 Node *n = node(h, i); 134 Node *n = node(h, i);
135 if (ttype(val(n)) == LUA_TNIL) { 135 if (ttype(val(n)) == LUA_TNIL) {
136 if (ttype(key(n)) != LUA_TNIL) 136 if (ttype_key(n) != LUA_TNIL)
137 sethvalue(key(n), NULL); /* dead key; remove it */ 137 n->key_value.v = NULL; /* dead key; remove it */
138 } 138 }
139 else { 139 else {
140 markobject(st, &n->key); 140 lua_assert(ttype_key(n) != LUA_TNIL);
141 if (ttype_key(n) != LUA_TNUMBER) {
142 TObject o;
143 setkey2obj(&o, n);
144 markobject(st, &o);
145 }
141 markobject(st, &n->val); 146 markobject(st, &n->val);
142 } 147 }
143 } 148 }