emergency garbage collector (core forces a GC when allocation fails)

This commit is contained in:
Roberto Ierusalimschy
2006-07-11 12:53:29 -03:00
parent c7b89dd280
commit 3ca9af51a4
19 changed files with 190 additions and 153 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstate.h,v 2.23 2005/07/09 13:22:34 roberto Exp roberto $
** $Id: lstate.h,v 2.24 2006/02/06 18:27:59 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@@ -71,6 +71,7 @@ typedef struct global_State {
void *ud; /* auxiliary data to `frealloc' */
lu_byte currentwhite;
lu_byte gcstate; /* state of garbage collector */
lu_byte emergencygc; /* true when collect was trigged by alloc error */
int sweepstrgc; /* position of sweep in `strt' */
GCObject *rootgc; /* list of all collectable objects */
GCObject **sweepgc; /* position of sweep in `rootgc' */
@@ -161,7 +162,6 @@ union GCObject {
#define obj2gco(v) (cast(GCObject *, (v)))
LUAI_FUNC lua_State *luaE_newthread (lua_State *L);
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
#endif