commit dabe09518fd1509597e55d9f2819c418eabd82c0
parent 65f28f0824411bfe375a1dfa08c9cdc0eea2cb36
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Tue, 8 Nov 1994 18:07:35 -0200
garbage collection for locked objects
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/table.c b/table.c
@@ -3,7 +3,7 @@
** Module to control static tables
*/
-char *rcs_table="$Id: table.c,v 2.11 1994/11/04 17:20:00 roberto Exp roberto $";
+char *rcs_table="$Id: table.c,v 2.12 1994/11/07 16:34:44 roberto Exp roberto $";
#include <stdlib.h>
#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 $";
#include "inout.h"
#include "table.h"
#include "lua.h"
+#include "fallback.h"
#define streq(s1,s2) (s1[0]==s2[0]&&strcmp(s1+1,s2+1)==0)
@@ -69,6 +70,8 @@ static void lua_initsymbol (void)
s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_internaldostring;
n = lua_findsymbol("setfallback");
s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_setfallback;
+ n = lua_findsymbol("error");
+ s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_error;
}
@@ -195,12 +198,15 @@ void lua_markobject (Object *o)
*/
void lua_pack (void)
{
- /* mark stack strings */
+ /* mark stack objects */
lua_travstack(lua_markobject);
- /* mark symbol table strings */
+ /* mark symbol table objects */
lua_travsymbol(lua_markobject);
+ /* mark locked objects */
+ luaI_travlock(lua_markobject);
+
lua_recovered=0;
lua_strcollector();