aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/lgc.c b/lgc.c
index 03326df3..5dba56fc 100644
--- a/lgc.c
+++ b/lgc.c
@@ -161,18 +161,17 @@ static void linkgclist_ (GCObject *o, GCObject **pnext, GCObject **list) {
161 161
162 162
163/* 163/*
164** Clear keys for empty entries in tables. If entry is empty 164** Clear keys for empty entries in tables. If entry is empty, mark its
165** and its key is not marked, mark its entry as dead. This allows the 165** entry as dead. This allows the collection of the key, but keeps its
166** collection of the key, but keeps its entry in the table (its removal 166** entry in the table: its removal could break a chain and could break
167** could break a chain). The main feature of a dead key is that it must 167** a table traversal. Other places never manipulate dead keys, because
168** be different from any other value, to do not disturb searches. 168** its associated empty value is enough to signal that the entry is
169** Other places never manipulate dead keys, because its associated empty 169** logically empty.
170** value is enough to signal that the entry is logically empty.
171*/ 170*/
172static void clearkey (Node *n) { 171static void clearkey (Node *n) {
173 lua_assert(isempty(gval(n))); 172 lua_assert(isempty(gval(n)));
174 if (keyiswhite(n)) 173 if (keyiscollectable(n))
175 setdeadkey(n); /* unused and unmarked key; remove it */ 174 setdeadkey(n); /* unused key; remove it */
176} 175}
177 176
178 177