aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-12-20 11:06:27 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-12-20 11:06:27 -0300
commit666e95a66d1a2ceb98bdf320980b3f655264a9c9 (patch)
tree663862abbb42c78f6bc31f7975777e60f8340ebe /ltests.c
parent4eda1acafa1a69224b2d4f786cf1ec8f7a4d9ac5 (diff)
downloadlua-666e95a66d1a2ceb98bdf320980b3f655264a9c9.tar.gz
lua-666e95a66d1a2ceb98bdf320980b3f655264a9c9.tar.bz2
lua-666e95a66d1a2ceb98bdf320980b3f655264a9c9.zip
Option 0 for step multiplier makes GC non-incremental
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ltests.c b/ltests.c
index 9bc2f0da..51e4ff9b 100644
--- a/ltests.c
+++ b/ltests.c
@@ -941,10 +941,10 @@ static int gc_printobj (lua_State *L) {
941 941
942static int gc_state (lua_State *L) { 942static int gc_state (lua_State *L) {
943 static const char *statenames[] = { 943 static const char *statenames[] = {
944 "propagate", "atomic", "enteratomic", "sweepallgc", "sweepfinobj", 944 "propagate", "atomic", "sweepallgc", "sweepfinobj",
945 "sweeptobefnz", "sweepend", "callfin", "pause", ""}; 945 "sweeptobefnz", "sweepend", "callfin", "pause", ""};
946 static const int states[] = { 946 static const int states[] = {
947 GCSpropagate, GCSenteratomic, GCSatomic, GCSswpallgc, GCSswpfinobj, 947 GCSpropagate, GCSenteratomic, GCSswpallgc, GCSswpfinobj,
948 GCSswptobefnz, GCSswpend, GCScallfin, GCSpause, -1}; 948 GCSswptobefnz, GCSswpend, GCScallfin, GCSpause, -1};
949 int option = states[luaL_checkoption(L, 1, "", statenames)]; 949 int option = states[luaL_checkoption(L, 1, "", statenames)];
950 if (option == -1) { 950 if (option == -1) {
@@ -957,9 +957,9 @@ static int gc_state (lua_State *L) {
957 luaL_error(L, "cannot change states in generational mode"); 957 luaL_error(L, "cannot change states in generational mode");
958 lua_lock(L); 958 lua_lock(L);
959 if (option < g->gcstate) { /* must cross 'pause'? */ 959 if (option < g->gcstate) { /* must cross 'pause'? */
960 luaC_runtilstate(L, bitmask(GCSpause)); /* run until pause */ 960 luaC_runtilstate(L, GCSpause, 1); /* run until pause */
961 } 961 }
962 luaC_runtilstate(L, bitmask(option)); 962 luaC_runtilstate(L, option, 0); /* do not skip propagation state */
963 lua_assert(G(L)->gcstate == option); 963 lua_assert(G(L)->gcstate == option);
964 lua_unlock(L); 964 lua_unlock(L);
965 return 0; 965 return 0;