new function 'luaC_runtilstate' to advance GC until a "valid" state

This commit is contained in:
Roberto Ierusalimschy
2009-12-11 17:14:59 -02:00
parent 2e51792596
commit a2a2abcba4
4 changed files with 35 additions and 21 deletions

17
lgc.h
View File

@@ -1,5 +1,5 @@
/*
** $Id: lgc.h,v 2.23 2009/11/18 13:13:47 roberto Exp roberto $
** $Id: lgc.h,v 2.24 2009/11/26 11:39:20 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@@ -14,16 +14,14 @@
/*
** Possible states of the Garbage Collector
*/
#define GCSpause 0
#define GCSpropagate 1
#define GCSatomic 2
#define GCSsweepstring 3
#define GCSsweep 4
#define GCSfinalize 5
#define GCSpause 1
#define GCSpropagate 2
#define GCSatomic 4
#define GCSsweepstring 8
#define GCSsweep 16
#define GCSfinalize 32
#define issweep(g) (GCSsweepstring <= (g)->gcstate && (g)->gcstate <= GCSsweep)
/*
** some useful bit tricks
@@ -98,6 +96,7 @@
LUAI_FUNC void luaC_separateudata (lua_State *L, int all);
LUAI_FUNC void luaC_freeallobjects (lua_State *L);
LUAI_FUNC void luaC_step (lua_State *L);
LUAI_FUNC void luaC_runtilstate (lua_State *L, int validstates);
LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency);
LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);