diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-09-24 18:12:01 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-09-24 18:12:01 -0300 |
commit | 87912786af9125d062babe2497fc4cb664728eda (patch) | |
tree | 07cc2752b09679dfa8c61775cd54d01ea452e69d /lgc.c | |
parent | 5645a84368f2a515281da60f96e09d0fdeaf0470 (diff) | |
download | lua-87912786af9125d062babe2497fc4cb664728eda.tar.gz lua-87912786af9125d062babe2497fc4cb664728eda.tar.bz2 lua-87912786af9125d062babe2497fc4cb664728eda.zip |
dead objects are not collectable.
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 | */ |
105 | static void removeentry (Node *n) { | 106 | static 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 | ||