diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-03-21 18:39:57 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-03-21 18:39:57 -0300 |
commit | c3488f51152ea2705ef6a256de7756cbeaf044f6 (patch) | |
tree | 9f57c6a177ee9f0f331f42690451cad1bfa4a830 | |
parent | 6fef372fb8b14be806070d6c2e96fd2b9cb2e41a (diff) | |
download | lua-c3488f51152ea2705ef6a256de7756cbeaf044f6.tar.gz lua-c3488f51152ea2705ef6a256de7756cbeaf044f6.tar.bz2 lua-c3488f51152ea2705ef6a256de7756cbeaf044f6.zip |
must call "gc" i.m. for nil after all others.
-rw-r--r-- | hash.c | 4 | ||||
-rw-r--r-- | table.c | 10 |
2 files changed, 10 insertions, 4 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** hash manager for lua | 3 | ** hash manager for lua |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_hash="$Id: hash.c,v 2.35 1997/03/11 18:44:28 roberto Exp roberto $"; | 6 | char *rcs_hash="$Id: hash.c,v 2.36 1997/03/19 19:41:10 roberto Exp roberto $"; |
7 | 7 | ||
8 | 8 | ||
9 | #include "mem.h" | 9 | #include "mem.h" |
@@ -170,8 +170,6 @@ void luaI_hashcallIM (void) | |||
170 | avalue(&t) = curr_array; | 170 | avalue(&t) = curr_array; |
171 | luaI_gcIM(&t); | 171 | luaI_gcIM(&t); |
172 | } | 172 | } |
173 | ttype(&t) = LUA_T_NIL; | ||
174 | luaI_gcIM(&t); /* end of list */ | ||
175 | } | 173 | } |
176 | 174 | ||
177 | 175 | ||
@@ -3,7 +3,7 @@ | |||
3 | ** Module to control static tables | 3 | ** Module to control static tables |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_table="$Id: table.c,v 2.60 1997/03/11 18:44:28 roberto Exp roberto $"; | 6 | char *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 | ||
160 | static 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(); |