diff options
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 | ||
242 | void luaC_collect (lua_State *L, int all) { | 242 | void 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 | ||