summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-12-21 16:04:41 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-12-21 16:04:41 -0200
commit6c79a0a80d517354dcc19a1ef64569fba9b19365 (patch)
tree3e5bd168c460c32dc198ef06fbae4c4b917e7341 /lgc.c
parent3daeabb60667adc8d4b9c570631704548099a7bf (diff)
downloadlua-6c79a0a80d517354dcc19a1ef64569fba9b19365.tar.gz
lua-6c79a0a80d517354dcc19a1ef64569fba9b19365.tar.bz2
lua-6c79a0a80d517354dcc19a1ef64569fba9b19365.zip
new way to control hooks inside hooks (now the control is done inside Lua)
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lgc.c b/lgc.c
index ceade0a4..2e9aa590 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.35 1999/12/01 19:50:08 roberto Exp roberto $ 2** $Id: lgc.c,v 1.36 1999/12/14 18:31:20 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -240,12 +240,15 @@ static void markall (lua_State *L) {
240 240
241 241
242void luaC_collect (lua_State *L, int all) { 242void luaC_collect (lua_State *L, int all) {
243 int oldah = L->allowhooks;
244 L->allowhooks = 0; /* stop debug hooks during GC */
243 L->GCthreshold *= 4; /* to avoid GC during GC */ 245 L->GCthreshold *= 4; /* to avoid GC during GC */
244 tableTM(L); /* call TM for tables (if LUA_COMPAT_GC) */ 246 tableTM(L); /* call TM for tables (if LUA_COMPAT_GC) */
245 collecttable(L); 247 collecttable(L);
246 collectstring(L, all?MAX_INT:1); 248 collectstring(L, all?MAX_INT:1);
247 collectproto(L); 249 collectproto(L);
248 collectclosure(L); 250 collectclosure(L);
251 L->allowhooks = oldah; /* restore hooks */
249} 252}
250 253
251 254