From a73930228aada18cb9300f53dbcc6fafcb75caf9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 11 Feb 2008 13:45:30 -0200 Subject: more options for 'kinds' of Garbage Collection --- lstate.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index cffaf0a2..611e7b0d 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.29 2007/10/29 16:51:20 roberto Exp roberto $ +** $Id: lstate.h,v 2.30 2007/10/31 15:41:19 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -34,6 +34,11 @@ struct lua_longjmp; /* defined in ldo.c */ #define BASIC_STACK_SIZE (2*LUA_MINSTACK) +/* kinds of Garbage Collection */ +#define KGC_NORMAL 0 +#define KGC_FORCED 1 /* gc was forced by the program */ +#define KGC_EMERGENCY 2 /* gc was forced by an allocation failure */ + typedef struct stringtable { GCObject **hash; @@ -72,7 +77,7 @@ typedef struct global_State { unsigned short nCcalls; /* number of nested C calls */ lu_byte currentwhite; lu_byte gcstate; /* state of garbage collector */ - lu_byte emergencygc; /* true when collect was trigged by alloc error */ + lu_byte gckind; /* kind of GC running */ int sweepstrgc; /* position of sweep in `strt' */ GCObject *rootgc; /* list of all collectable objects */ GCObject **sweepgc; /* position of sweep in `rootgc' */ -- cgit v1.2.3-55-g6feb