test for whether collector is running moved from function to

macro 'luaC_condGC'.
This commit is contained in:
Roberto Ierusalimschy
2012-05-11 16:22:33 -03:00
parent c2361e0b61
commit 31829ad177
3 changed files with 8 additions and 16 deletions

14
lgc.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lgc.c,v 2.119 2012/01/25 21:05:40 roberto Exp roberto $
** $Id: lgc.c,v 2.120 2012/05/08 13:53:33 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@@ -1069,9 +1069,9 @@ static void step (lua_State *L) {
/*
** performs a basic GC step even if the collector is stopped
** performs a basic GC step
*/
void luaC_forcestep (lua_State *L) {
void luaC_step (lua_State *L) {
global_State *g = G(L);
int i;
if (isgenerational(g)) generationalcollection(L);
@@ -1081,14 +1081,6 @@ void luaC_forcestep (lua_State *L) {
}
/*
** performs a basic GC step only if collector is running
*/
void luaC_step (lua_State *L) {
if (G(L)->gcrunning) luaC_forcestep(L);
}
/*
** performs a full GC cycle; if "isemergency", does not call
** finalizers (which could change stack positions)