aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-11-03 16:10:44 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-11-03 16:10:44 -0200
commit748551238451acf36a245fb2f883293149e2f0ca (patch)
tree54ddfebfa1ebc31392a210b50baa64a042d09223 /lgc.c
parent46de77b219e381ff8553fdba0f52b319c00ea1e1 (diff)
downloadlua-748551238451acf36a245fb2f883293149e2f0ca.tar.gz
lua-748551238451acf36a245fb2f883293149e2f0ca.tar.bz2
lua-748551238451acf36a245fb2f883293149e2f0ca.zip
added comment and assert about dead keys
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lgc.c b/lgc.c
index 47aa05e2..31c956fd 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.208 2015/11/02 16:19:29 roberto Exp roberto $ 2** $Id: lgc.c,v 2.209 2015/11/02 18:48:07 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*/
@@ -114,8 +114,13 @@ static void reallymarkobject (global_State *g, GCObject *o);
114 114
115 115
116/* 116/*
117** if key is not marked, mark its entry as dead (therefore removing it 117** If key is not marked, mark its entry as dead. This allows key to be
118** from the table) 118** collected, but keeps its entry in the table. A dead node is needed
119** when Lua looks up for a key (it may be part of a chain) and when
120** traversing a weak table (key might be removed from the table during
121** traversal). Other places never manipulate dead keys, because its
122** associated nil value is enough to signal that the entry is logically
123** empty.
119*/ 124*/
120static void removeentry (Node *n) { 125static void removeentry (Node *n) {
121 lua_assert(ttisnil(gval(n))); 126 lua_assert(ttisnil(gval(n)));