aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-09-24 18:12:01 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-09-24 18:12:01 -0300
commit87912786af9125d062babe2497fc4cb664728eda (patch)
tree07cc2752b09679dfa8c61775cd54d01ea452e69d /lgc.c
parent5645a84368f2a515281da60f96e09d0fdeaf0470 (diff)
downloadlua-87912786af9125d062babe2497fc4cb664728eda.tar.gz
lua-87912786af9125d062babe2497fc4cb664728eda.tar.bz2
lua-87912786af9125d062babe2497fc4cb664728eda.zip
dead objects are not collectable.
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lgc.c b/lgc.c
index 89cdd2c5..1c741a4a 100644
--- a/lgc.c
+++ b/lgc.c
@@ -100,12 +100,13 @@ static void reallymarkobject (global_State *g, GCObject *o);
100 100
101 101
102/* 102/*
103** mark a table entry as dead (therefore removing it from the table) 103** if key is not marked, mark its entry as dead (therefore removing it
104** from the table)
104*/ 105*/
105static void removeentry (Node *n) { 106static void removeentry (Node *n) {
106 lua_assert(ttisnil(gval(n))); 107 lua_assert(ttisnil(gval(n)));
107 if (iscollectable(gkey(n))) 108 if (valiswhite(gkey(n)))
108 setdeadvalue(gkey(n)); /* dead key; remove it */ 109 setdeadvalue(gkey(n)); /* unused and unmarked key; remove it */
109} 110}
110 111
111 112