aboutsummaryrefslogtreecommitdiff
path: root/table.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-03-21 18:39:57 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-03-21 18:39:57 -0300
commitc3488f51152ea2705ef6a256de7756cbeaf044f6 (patch)
tree9f57c6a177ee9f0f331f42690451cad1bfa4a830 /table.c
parent6fef372fb8b14be806070d6c2e96fd2b9cb2e41a (diff)
downloadlua-c3488f51152ea2705ef6a256de7756cbeaf044f6.tar.gz
lua-c3488f51152ea2705ef6a256de7756cbeaf044f6.tar.bz2
lua-c3488f51152ea2705ef6a256de7756cbeaf044f6.zip
must call "gc" i.m. for nil after all others.
Diffstat (limited to 'table.c')
-rw-r--r--table.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/table.c b/table.c
index e545195f..c9bdafba 100644
--- a/table.c
+++ b/table.c
@@ -3,7 +3,7 @@
3** Module to control static tables 3** Module to control static tables
4*/ 4*/
5 5
6char *rcs_table="$Id: table.c,v 2.60 1997/03/11 18:44:28 roberto Exp roberto $"; 6char *rcs_table="$Id: table.c,v 2.62 1997/03/21 18:52:37 roberto Exp $";
7 7
8#include "mem.h" 8#include "mem.h"
9#include "opcode.h" 9#include "opcode.h"
@@ -157,6 +157,13 @@ int luaI_ismarked (Object *o)
157} 157}
158 158
159 159
160static void call_nilIM (void)
161{ /* signals end of garbage collection */
162 Object t;
163 ttype(&t) = LUA_T_NIL;
164 luaI_gcIM(&t); /* end of list */
165}
166
160/* 167/*
161** Garbage collection. 168** Garbage collection.
162** Delete all unused strings and arrays. 169** Delete all unused strings and arrays.
@@ -170,6 +177,7 @@ Long luaI_collectgarbage (void)
170 luaI_travfallbacks(lua_markobject); /* mark fallbacks */ 177 luaI_travfallbacks(lua_markobject); /* mark fallbacks */
171 luaI_hashcallIM(); 178 luaI_hashcallIM();
172 luaI_strcallIM(); 179 luaI_strcallIM();
180 call_nilIM();
173 luaI_invalidaterefs(); 181 luaI_invalidaterefs();
174 recovered += lua_strcollector(); 182 recovered += lua_strcollector();
175 recovered += lua_hashcollector(); 183 recovered += lua_hashcollector();