2 ** $Id: lstate.h,v 1.19 1999/05/11 20:08:20 roberto Exp $
4 ** See Copyright Notice in lua.h
17 #define GARBAGE_BLOCK 150
20 typedef int StkId
; /* index to stack elements */
24 ** "jmp_buf" may be an array, so it is better to make sure it has an
25 ** address (and not that it *is* an address...)
39 StkId base
; /* when Lua calls C or C calls Lua, points to */
40 /* the first slot after the last parameter. */
41 StkId lua2C
; /* points to first element of "array" lua2C */
42 int num
; /* size of "array" lua2C */
46 typedef struct stringtable
{
48 int nuse
; /* number of elements (including EMPTYs) */
53 enum Status
{LOCK
, HOLD
, FREE
, COLLECTED
};
62 /* thread-specific state */
63 struct Stack stack
; /* Lua stack */
64 struct C_Lua_Stack Cstack
; /* C2lua struct */
65 struct lua_longjmp
*errorJmp
; /* current error recover point */
66 char *Mbuffer
; /* global buffer */
67 int Mbuffbase
; /* current first position of Mbuffer */
68 int Mbuffsize
; /* size of Mbuffer */
69 int Mbuffnext
; /* next position to fill in Mbuffer */
70 struct C_Lua_Stack
*Cblocks
;
71 int numCblocks
; /* number of nested Cblocks */
73 lua_CHFunction callhook
;
74 lua_LHFunction linehook
;
76 GCnode rootproto
; /* list of all prototypes */
77 GCnode rootcl
; /* list of all closures */
78 GCnode roottable
; /* list of all tables */
79 GCnode rootglobal
; /* list of strings with global values */
80 stringtable
*string_root
; /* array of hash tables for strings and udata */
81 struct IM
*IMtable
; /* table for tag methods */
82 int last_tag
; /* last used tag in IMtable */
83 struct ref
*refArray
; /* locked objects */
84 int refSize
; /* size of refArray */
85 unsigned long GCthreshold
;
86 unsigned long nblocks
; /* number of 'blocks' currently allocated */