diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-12-20 11:06:27 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-12-20 11:06:27 -0300 |
commit | 666e95a66d1a2ceb98bdf320980b3f655264a9c9 (patch) | |
tree | 663862abbb42c78f6bc31f7975777e60f8340ebe /ltests.c | |
parent | 4eda1acafa1a69224b2d4f786cf1ec8f7a4d9ac5 (diff) | |
download | lua-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -941,10 +941,10 @@ static int gc_printobj (lua_State *L) { | |||
941 | 941 | ||
942 | static int gc_state (lua_State *L) { | 942 | static 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; |