diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-07-02 12:38:36 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-07-02 12:38:36 -0300 |
commit | 5ac56a94dd318aa3db031a31bdc03efb45386b9f (patch) | |
tree | 6b901ea97d7063305e5d0ab660a06b9bdbf6675a | |
parent | 4fc15bbfb731d1258c2771d45078bbbb51bff700 (diff) | |
download | lua-5ac56a94dd318aa3db031a31bdc03efb45386b9f.tar.gz lua-5ac56a94dd318aa3db031a31bdc03efb45386b9f.tar.bz2 lua-5ac56a94dd318aa3db031a31bdc03efb45386b9f.zip |
collector in generational mode should never be in 'pause' state
-rw-r--r-- | ltests.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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); |