aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-07-02 12:38:36 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-07-02 12:38:36 -0300
commit5ac56a94dd318aa3db031a31bdc03efb45386b9f (patch)
tree6b901ea97d7063305e5d0ab660a06b9bdbf6675a
parent4fc15bbfb731d1258c2771d45078bbbb51bff700 (diff)
downloadlua-5ac56a94dd318aa3db031a31bdc03efb45386b9f.tar.gz
lua-5ac56a94dd318aa3db031a31bdc03efb45386b9f.tar.bz2
lua-5ac56a94dd318aa3db031a31bdc03efb45386b9f.zip
collector in generational mode should never be in 'pause' state
-rw-r--r--ltests.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ltests.c b/ltests.c
index de353f1c..0a8b526a 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.129 2012/05/31 20:25:42 roberto Exp $ 2** $Id: ltests.c,v 2.130 2012/06/07 18:52:47 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -663,7 +663,15 @@ static int gc_state (lua_State *L) {
663 return 1; 663 return 1;
664 } 664 }
665 else { 665 else {
666 global_State *g = G(L);
667 if (g->gckind == KGC_GEN && option == GCSpause)
668 luaL_error(L, "cannot go to 'pause' state in generational mode");
666 lua_lock(L); 669 lua_lock(L);
670 if (option < g->gcstate) { /* must cross 'pause'? */
671 luaC_runtilstate(L, bitmask(GCSpause)); /* run until pause */
672 if (g->gckind == KGC_GEN)
673 g->gcstate = GCSpropagate; /* skip pause in gen. mode */
674 }
667 luaC_runtilstate(L, bitmask(option)); 675 luaC_runtilstate(L, bitmask(option));
668 lua_assert(G(L)->gcstate == option); 676 lua_assert(G(L)->gcstate == option);
669 lua_unlock(L); 677 lua_unlock(L);