mirror of
https://github.com/lua/lua.git
synced 2025-01-28 06:03:00 +08:00
updated GC states in function 'T.gcstate'
This commit is contained in:
parent
72d82a296c
commit
8821746841
12
ltests.c
12
ltests.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ltests.c,v 2.216 2017/04/24 18:06:12 roberto Exp roberto $
|
** $Id: ltests.c,v 2.217 2017/05/04 13:32:01 roberto Exp $
|
||||||
** Internal Module for Debugging of the Lua Implementation
|
** Internal Module for Debugging of the Lua Implementation
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -734,10 +734,12 @@ static int gc_printobj (lua_State *L) {
|
|||||||
|
|
||||||
|
|
||||||
static int gc_state (lua_State *L) {
|
static int gc_state (lua_State *L) {
|
||||||
static const char *statenames[] = {"propagate", "atomic", "sweepallgc",
|
static const char *statenames[] = {
|
||||||
"sweepfinobj", "sweeptobefnz", "sweepend", "pause", ""};
|
"propagate", "atomic", "enteratomic", "sweepallgc", "sweepfinobj",
|
||||||
static const int states[] = {GCSpropagate, GCSenteratomic, GCSswpallgc,
|
"sweeptobefnz", "sweepend", "callfin", "pause", ""};
|
||||||
GCSswpfinobj, GCSswptobefnz, GCSswpend, GCSpause, -1};
|
static const int states[] = {
|
||||||
|
GCSpropagate, GCSenteratomic, GCSatomic, GCSswpallgc, GCSswpfinobj,
|
||||||
|
GCSswptobefnz, GCSswpend, GCScallfin, GCSpause, -1};
|
||||||
int option = states[luaL_checkoption(L, 1, "", statenames)];
|
int option = states[luaL_checkoption(L, 1, "", statenames)];
|
||||||
if (option == -1) {
|
if (option == -1) {
|
||||||
lua_pushstring(L, statenames[G(L)->gcstate]);
|
lua_pushstring(L, statenames[G(L)->gcstate]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user