aboutsummaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-02-11 13:45:30 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-02-11 13:45:30 -0200
commita73930228aada18cb9300f53dbcc6fafcb75caf9 (patch)
treed3a63c01e23c1d3c2a930d7d2b4607aaf6cbe559 /lstate.h
parenta76fa251998ea83679cfad24542cf4c1aa3d6131 (diff)
downloadlua-a73930228aada18cb9300f53dbcc6fafcb75caf9.tar.gz
lua-a73930228aada18cb9300f53dbcc6fafcb75caf9.tar.bz2
lua-a73930228aada18cb9300f53dbcc6fafcb75caf9.zip
more options for 'kinds' of Garbage Collection
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lstate.h b/lstate.h
index cffaf0a2..611e7b0d 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 2.29 2007/10/29 16:51:20 roberto Exp roberto $ 2** $Id: lstate.h,v 2.30 2007/10/31 15:41:19 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -34,6 +34,11 @@ struct lua_longjmp; /* defined in ldo.c */
34#define BASIC_STACK_SIZE (2*LUA_MINSTACK) 34#define BASIC_STACK_SIZE (2*LUA_MINSTACK)
35 35
36 36
37/* kinds of Garbage Collection */
38#define KGC_NORMAL 0
39#define KGC_FORCED 1 /* gc was forced by the program */
40#define KGC_EMERGENCY 2 /* gc was forced by an allocation failure */
41
37 42
38typedef struct stringtable { 43typedef struct stringtable {
39 GCObject **hash; 44 GCObject **hash;
@@ -72,7 +77,7 @@ typedef struct global_State {
72 unsigned short nCcalls; /* number of nested C calls */ 77 unsigned short nCcalls; /* number of nested C calls */
73 lu_byte currentwhite; 78 lu_byte currentwhite;
74 lu_byte gcstate; /* state of garbage collector */ 79 lu_byte gcstate; /* state of garbage collector */
75 lu_byte emergencygc; /* true when collect was trigged by alloc error */ 80 lu_byte gckind; /* kind of GC running */
76 int sweepstrgc; /* position of sweep in `strt' */ 81 int sweepstrgc; /* position of sweep in `strt' */
77 GCObject *rootgc; /* list of all collectable objects */ 82 GCObject *rootgc; /* list of all collectable objects */
78 GCObject **sweepgc; /* position of sweep in `rootgc' */ 83 GCObject **sweepgc; /* position of sweep in `rootgc' */