From 5ac56a94dd318aa3db031a31bdc03efb45386b9f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 2 Jul 2012 12:38:36 -0300 Subject: collector in generational mode should never be in 'pause' state --- ltests.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index de353f1c..0a8b526a 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.129 2012/05/31 20:25:42 roberto Exp $ +** $Id: ltests.c,v 2.130 2012/06/07 18:52:47 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -663,7 +663,15 @@ static int gc_state (lua_State *L) { return 1; } else { + global_State *g = G(L); + if (g->gckind == KGC_GEN && option == GCSpause) + luaL_error(L, "cannot go to 'pause' state in generational mode"); lua_lock(L); + if (option < g->gcstate) { /* must cross 'pause'? */ + luaC_runtilstate(L, bitmask(GCSpause)); /* run until pause */ + if (g->gckind == KGC_GEN) + g->gcstate = GCSpropagate; /* skip pause in gen. mode */ + } luaC_runtilstate(L, bitmask(option)); lua_assert(G(L)->gcstate == option); lua_unlock(L); -- cgit v1.2.3-55-g6feb