aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-08 18:07:54 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-08 18:07:54 -0200
commitdabe09518fd1509597e55d9f2819c418eabd82c0 (patch)
treeae0d71c0ce445b5d32473789a42575c2ed053787
parent65f28f0824411bfe375a1dfa08c9cdc0eea2cb36 (diff)
downloadlua-dabe09518fd1509597e55d9f2819c418eabd82c0.tar.gz
lua-dabe09518fd1509597e55d9f2819c418eabd82c0.tar.bz2
lua-dabe09518fd1509597e55d9f2819c418eabd82c0.zip
garbage collection for locked objects
-rw-r--r--table.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/table.c b/table.c
index 42142f19..2ee29847 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.11 1994/11/04 17:20:00 roberto Exp roberto $"; 6char *rcs_table="$Id: table.c,v 2.12 1994/11/07 16:34:44 roberto Exp roberto $";
7 7
8#include <stdlib.h> 8#include <stdlib.h>
9#include <string.h> 9#include <string.h>
@@ -14,6 +14,7 @@ char *rcs_table="$Id: table.c,v 2.11 1994/11/04 17:20:00 roberto Exp roberto $";
14#include "inout.h" 14#include "inout.h"
15#include "table.h" 15#include "table.h"
16#include "lua.h" 16#include "lua.h"
17#include "fallback.h"
17 18
18#define streq(s1,s2) (s1[0]==s2[0]&&strcmp(s1+1,s2+1)==0) 19#define streq(s1,s2) (s1[0]==s2[0]&&strcmp(s1+1,s2+1)==0)
19 20
@@ -69,6 +70,8 @@ static void lua_initsymbol (void)
69 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_internaldostring; 70 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_internaldostring;
70 n = lua_findsymbol("setfallback"); 71 n = lua_findsymbol("setfallback");
71 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_setfallback; 72 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_setfallback;
73 n = lua_findsymbol("error");
74 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_error;
72} 75}
73 76
74 77
@@ -195,12 +198,15 @@ void lua_markobject (Object *o)
195*/ 198*/
196void lua_pack (void) 199void lua_pack (void)
197{ 200{
198 /* mark stack strings */ 201 /* mark stack objects */
199 lua_travstack(lua_markobject); 202 lua_travstack(lua_markobject);
200 203
201 /* mark symbol table strings */ 204 /* mark symbol table objects */
202 lua_travsymbol(lua_markobject); 205 lua_travsymbol(lua_markobject);
203 206
207 /* mark locked objects */
208 luaI_travlock(lua_markobject);
209
204 lua_recovered=0; 210 lua_recovered=0;
205 211
206 lua_strcollector(); 212 lua_strcollector();