From 6c79a0a80d517354dcc19a1ef64569fba9b19365 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 21 Dec 1999 16:04:41 -0200 Subject: new way to control hooks inside hooks (now the control is done inside Lua) --- lgc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lgc.c') diff --git a/lgc.c b/lgc.c index ceade0a4..2e9aa590 100644 --- a/lgc.c +++ b/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 1.35 1999/12/01 19:50:08 roberto Exp roberto $ +** $Id: lgc.c,v 1.36 1999/12/14 18:31:20 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -240,12 +240,15 @@ static void markall (lua_State *L) { void luaC_collect (lua_State *L, int all) { + int oldah = L->allowhooks; + L->allowhooks = 0; /* stop debug hooks during GC */ L->GCthreshold *= 4; /* to avoid GC during GC */ tableTM(L); /* call TM for tables (if LUA_COMPAT_GC) */ collecttable(L); collectstring(L, all?MAX_INT:1); collectproto(L); collectclosure(L); + L->allowhooks = oldah; /* restore hooks */ } -- cgit v1.2.3-55-g6feb