The Battle for Wesnoth  1.17.0-dev
lstate.cpp
Go to the documentation of this file.
1 /*
2 ** $Id: lstate.c $
3 ** Global State
4 ** See Copyright Notice in lua.h
5 */
6 
7 #define lstate_c
8 #define LUA_CORE
9 
10 #include "lprefix.h"
11 
12 
13 #include <stddef.h>
14 #include <string.h>
15 
16 #include "lua.h"
17 
18 #include "lapi.h"
19 #include "ldebug.h"
20 #include "ldo.h"
21 #include "lfunc.h"
22 #include "lgc.h"
23 #include "llex.h"
24 #include "lmem.h"
25 #include "lstate.h"
26 #include "lstring.h"
27 #include "ltable.h"
28 #include "ltm.h"
29 
30 
31 
32 /*
33 ** thread state + extra space
34 */
35 typedef struct LX {
38 } LX;
39 
40 
41 /*
42 ** Main thread combines a thread state and the global state
43 */
44 typedef struct LG {
45  LX l;
47 } LG;
48 
49 
50 
51 #define fromstate(L) (cast(LX *, cast(lu_byte *, (L)) - offsetof(LX, l)))
52 
53 
54 /*
55 ** A macro to create a "random" seed when a state is created;
56 ** the seed is used to randomize string hashes.
57 */
58 #if !defined(luai_makeseed)
59 
60 #include <time.h>
61 
62 /*
63 ** Compute an initial seed with some level of randomness.
64 ** Rely on Address Space Layout Randomization (if present) and
65 ** current time.
66 */
67 #define addbuff(b,p,e) \
68  { size_t t = cast_sizet(e); \
69  memcpy(b + p, &t, sizeof(t)); p += sizeof(t); }
70 
71 static unsigned int luai_makeseed (lua_State *L) {
72  char buff[3 * sizeof(size_t)];
73  unsigned int h = cast_uint(time(NULL));
74  int p = 0;
75  addbuff(buff, p, L); /* heap variable */
76  addbuff(buff, p, &h); /* local variable */
77  addbuff(buff, p, &lua_newstate); /* public function */
78  lua_assert(p == sizeof(buff));
79  return luaS_hash(buff, p, h);
80 }
81 
82 #endif
83 
84 
85 /*
86 ** set GCdebt to a new value keeping the value (totalbytes + GCdebt)
87 ** invariant (and avoiding underflows in 'totalbytes')
88 */
90  l_mem tb = gettotalbytes(g);
91  lua_assert(tb > 0);
92  if (debt < tb - MAX_LMEM)
93  debt = tb - MAX_LMEM; /* will make 'totalbytes == MAX_LMEM' */
94  g->totalbytes = tb - debt;
95  g->GCdebt = debt;
96 }
97 
98 
99 LUA_API int lua_setcstacklimit (lua_State *L, unsigned int limit) {
100  UNUSED(L); UNUSED(limit);
101  return LUAI_MAXCCALLS; /* warning?? */
102 }
103 
104 
106  CallInfo *ci;
107  lua_assert(L->ci->next == NULL);
108  ci = luaM_new(L, CallInfo);
109  lua_assert(L->ci->next == NULL);
110  L->ci->next = ci;
111  ci->previous = L->ci;
112  ci->next = NULL;
113  ci->u.l.trap = 0;
114  L->nci++;
115  return ci;
116 }
117 
118 
119 /*
120 ** free all CallInfo structures not in use by a thread
121 */
123  CallInfo *ci = L->ci;
124  CallInfo *next = ci->next;
125  ci->next = NULL;
126  while ((ci = next) != NULL) {
127  next = ci->next;
128  luaM_free(L, ci);
129  L->nci--;
130  }
131 }
132 
133 
134 /*
135 ** free half of the CallInfo structures not in use by a thread,
136 ** keeping the first one.
137 */
139  CallInfo *ci = L->ci->next; /* first free CallInfo */
140  CallInfo *next;
141  if (ci == NULL)
142  return; /* no extra elements */
143  while ((next = ci->next) != NULL) { /* two extra elements? */
144  CallInfo *next2 = next->next; /* next's next */
145  ci->next = next2; /* remove next from the list */
146  L->nci--;
147  luaM_free(L, next); /* free next */
148  if (next2 == NULL)
149  break; /* no more elements */
150  else {
151  next2->previous = ci;
152  ci = next2; /* continue */
153  }
154  }
155 }
156 
157 
158 /*
159 ** Called when 'getCcalls(L)' larger or equal to LUAI_MAXCCALLS.
160 ** If equal, raises an overflow error. If value is larger than
161 ** LUAI_MAXCCALLS (which means it is handling an overflow) but
162 ** not much larger, does not report an error (to allow overflow
163 ** handling to work).
164 */
166  if (getCcalls(L) == LUAI_MAXCCALLS)
167  luaG_runerror(L, "C stack overflow");
168  else if (getCcalls(L) >= (LUAI_MAXCCALLS / 10 * 11))
169  luaD_throw(L, LUA_ERRERR); /* error while handing stack error */
170 }
171 
172 
174  L->nCcalls++;
175  if (unlikely(getCcalls(L) >= LUAI_MAXCCALLS))
176  luaE_checkcstack(L);
177 }
178 
179 
180 static void stack_init (lua_State *L1, lua_State *L) {
181  int i; CallInfo *ci;
182  /* initialize stack array */
184  for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
185  setnilvalue(s2v(L1->stack + i)); /* erase new stack */
186  L1->top = L1->stack;
187  L1->stack_last = L1->stack + BASIC_STACK_SIZE;
188  /* initialize first ci */
189  ci = &L1->base_ci;
190  ci->next = ci->previous = NULL;
191  ci->callstatus = CIST_C;
192  ci->func = L1->top;
193  ci->u.c.k = NULL;
194  ci->nresults = 0;
195  setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */
196  L1->top++;
197  ci->top = L1->top + LUA_MINSTACK;
198  L1->ci = ci;
199 }
200 
201 
202 static void freestack (lua_State *L) {
203  if (L->stack == NULL)
204  return; /* stack not completely built yet */
205  L->ci = &L->base_ci; /* free the entire 'ci' list */
206  luaE_freeCI(L);
207  lua_assert(L->nci == 0);
208  luaM_freearray(L, L->stack, stacksize(L) + EXTRA_STACK); /* free stack */
209 }
210 
211 
212 /*
213 ** Create registry table and its predefined values
214 */
215 static void init_registry (lua_State *L, global_State *g) {
216  TValue temp;
217  /* create registry */
218  Table *registry = luaH_new(L);
219  sethvalue(L, &g->l_registry, registry);
220  luaH_resize(L, registry, LUA_RIDX_LAST, 0);
221  /* registry[LUA_RIDX_MAINTHREAD] = L */
222  setthvalue(L, &temp, L); /* temp = L */
223  luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &temp);
224  /* registry[LUA_RIDX_GLOBALS] = table of globals */
225  sethvalue(L, &temp, luaH_new(L)); /* temp = new table (global table) */
226  luaH_setint(L, registry, LUA_RIDX_GLOBALS, &temp);
227 }
228 
229 
230 /*
231 ** open parts of the state that may cause memory-allocation errors.
232 ** ('g->nilvalue' being a nil value flags that the state was completely
233 ** build.)
234 */
235 static void f_luaopen (lua_State *L, void *ud) {
236  global_State *g = G(L);
237  UNUSED(ud);
238  stack_init(L, L); /* init stack */
239  init_registry(L, g);
240  luaS_init(L);
241  luaT_init(L);
242  luaX_init(L);
243  g->gcrunning = 1; /* allow gc */
244  setnilvalue(&g->nilvalue);
246 }
247 
248 
249 /*
250 ** preinitialize a thread with consistent values without allocating
251 ** any memory (to avoid errors)
252 */
254  G(L) = g;
255  L->stack = NULL;
256  L->ci = NULL;
257  L->nci = 0;
258  L->twups = L; /* thread has no upvalues */
259  L->errorJmp = NULL;
260  L->hook = NULL;
261  L->hookmask = 0;
262  L->basehookcount = 0;
263  L->allowhook = 1;
264  resethookcount(L);
265  L->openupval = NULL;
266  L->status = LUA_OK;
267  L->errfunc = 0;
268  L->oldpc = 0;
269 }
270 
271 
272 static void close_state (lua_State *L) {
273  global_State *g = G(L);
274  luaF_close(L, L->stack, CLOSEPROTECT); /* close all upvalues */
275  luaC_freeallobjects(L); /* collect all objects */
276  if (ttisnil(&g->nilvalue)) /* closing a fully built state? */
278  luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size);
279  freestack(L);
280  lua_assert(gettotalbytes(g) == sizeof(LG));
281  (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */
282 }
283 
284 
286  global_State *g;
287  lua_State *L1;
288  lua_lock(L);
289  g = G(L);
290  luaC_checkGC(L);
291  /* create new thread */
292  L1 = &cast(LX *, luaM_newobject(L, LUA_TTHREAD, sizeof(LX)))->l;
293  L1->marked = luaC_white(g);
294  L1->tt = LUA_VTHREAD;
295  /* link it on list 'allgc' */
296  L1->next = g->allgc;
297  g->allgc = obj2gco(L1);
298  /* anchor it on L stack */
299  setthvalue2s(L, L->top, L1);
300  api_incr_top(L);
301  preinit_thread(L1, g);
302  L1->nCcalls = 0;
303  L1->hookmask = L->hookmask;
304  L1->basehookcount = L->basehookcount;
305  L1->hook = L->hook;
306  resethookcount(L1);
307  /* initialize L1 extra space */
310  luai_userstatethread(L, L1);
311  stack_init(L1, L); /* init stack */
312  lua_unlock(L);
313  return L1;
314 }
315 
316 
318  LX *l = fromstate(L1);
319  luaF_close(L1, L1->stack, NOCLOSINGMETH); /* close all upvalues */
320  lua_assert(L1->openupval == NULL);
321  luai_userstatefree(L, L1);
322  freestack(L1);
323  luaM_free(L, l);
324 }
325 
326 
328  CallInfo *ci;
329  int status;
330  lua_lock(L);
331  L->ci = ci = &L->base_ci; /* unwind CallInfo list */
332  setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */
333  ci->func = L->stack;
334  ci->callstatus = CIST_C;
335  status = luaF_close(L, L->stack, CLOSEPROTECT);
336  if (status != CLOSEPROTECT) /* real errors? */
337  luaD_seterrorobj(L, status, L->stack + 1);
338  else {
339  status = LUA_OK;
340  L->top = L->stack + 1;
341  }
342  ci->top = L->top + LUA_MINSTACK;
343  L->status = status;
344  lua_unlock(L);
345  return status;
346 }
347 
348 
350  int i;
351  lua_State *L;
352  global_State *g;
353  LG *l = cast(LG *, (*f)(ud, NULL, LUA_TTHREAD, sizeof(LG)));
354  if (l == NULL) return NULL;
355  L = &l->l.l;
356  g = &l->g;
357  L->tt = LUA_VTHREAD;
359  L->marked = luaC_white(g);
360  preinit_thread(L, g);
361  g->allgc = obj2gco(L); /* by now, only object is the main thread */
362  L->next = NULL;
363  L->nCcalls = 0;
364  incnny(L); /* main thread is always non yieldable */
365  g->frealloc = f;
366  g->ud = ud;
367  g->warnf = NULL;
368  g->ud_warn = NULL;
369  g->mainthread = L;
370  g->seed = luai_makeseed(L);
371  g->gcrunning = 0; /* no GC while building state */
372  g->strt.size = g->strt.nuse = 0;
373  g->strt.hash = NULL;
374  setnilvalue(&g->l_registry);
375  g->panic = NULL;
376  g->gcstate = GCSpause;
377  g->gckind = KGC_INC;
378  g->gcemergency = 0;
379  g->finobj = g->tobefnz = g->fixedgc = NULL;
380  g->firstold1 = g->survival = g->old1 = g->reallyold = NULL;
381  g->finobjsur = g->finobjold1 = g->finobjrold = NULL;
382  g->sweepgc = NULL;
383  g->gray = g->grayagain = NULL;
384  g->weak = g->ephemeron = g->allweak = NULL;
385  g->twups = NULL;
386  g->totalbytes = sizeof(LG);
387  g->GCdebt = 0;
388  g->lastatomic = 0;
389  setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */
395  for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL;
396  if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) {
397  /* memory allocation error: free partial state */
398  close_state(L);
399  L = NULL;
400  }
401  return L;
402 }
403 
404 
406  lua_lock(L);
407  L = G(L)->mainthread; /* only the main thread can be closed */
408  close_state(L);
409 }
410 
411 
412 void luaE_warning (lua_State *L, const char *msg, int tocont) {
413  lua_WarnFunction wf = G(L)->warnf;
414  if (wf != NULL)
415  wf(G(L)->ud_warn, msg, tocont);
416 }
417 
418 
419 /*
420 ** Generate a warning from an error message
421 */
422 void luaE_warnerror (lua_State *L, const char *where) {
423  TValue *errobj = s2v(L->top - 1); /* error object */
424  const char *msg = (ttisstring(errobj))
425  ? svalue(errobj)
426  : "error object is not a string";
427  /* produce warning "error in %s (%s)" (where, msg) */
428  luaE_warning(L, "error in ", 1);
429  luaE_warning(L, where, 1);
430  luaE_warning(L, " (", 1);
431  luaE_warning(L, msg, 1);
432  luaE_warning(L, ")", 0);
433 }
434 
lu_byte genmajormul
Definition: lstate.h:234
unsigned short callstatus
Definition: lstate.h:185
lu_byte allowhook
Definition: lstate.h:276
void luaE_setdebt(global_State *g, l_mem debt)
Definition: lstate.cpp:89
void luaE_freethread(lua_State *L, lua_State *L1)
Definition: lstate.cpp:317
#define LUA_TTHREAD
Definition: lua.h:73
l_mem GCdebt
Definition: lstate.h:223
ptrdiff_t errfunc
Definition: lstate.h:289
l_noret luaG_runerror(lua_State *L, const char *fmt,...)
Definition: ldebug.cpp:767
#define luai_userstateclose(L)
Definition: llimits.h:275
Definition: lstate.cpp:44
#define luai_userstatefree(L, L1)
Definition: llimits.h:283
struct CallInfo::@13::@16 c
#define LUA_VTHREAD
Definition: lobject.h:240
struct LX LX
#define luaM_newvector(L, n, t)
Definition: lmem.h:60
void luaE_shrinkCI(lua_State *L)
Definition: lstate.cpp:138
#define s2v(o)
Definition: lobject.h:150
Definition: lobject.h:714
#define obj2gco(v)
Definition: lstate.h:347
unsigned int luaS_hash(const char *str, size_t l, unsigned int seed)
Definition: lstring.cpp:43
#define luaM_freearray(L, b, n)
Definition: lmem.h:57
StkId stack
Definition: lstate.h:282
#define LUAI_FUNC
Definition: luaconf.h:307
lu_byte gcpause
Definition: lstate.h:237
#define ttisstring(o)
Definition: lobject.h:341
lu_byte genminormul
Definition: lstate.h:233
struct LG LG
#define GCSpause
Definition: lgc.h:39
lua_Alloc frealloc
Definition: lstate.h:220
#define CLOSEPROTECT
Definition: lfunc.h:53
lua_WarnFunction warnf
Definition: lstate.h:265
unsigned short nci
Definition: lstate.h:277
int basehookcount
Definition: lstate.h:292
#define cast_uint(i)
Definition: llimits.h:129
StkId top
Definition: lstate.h:162
Definition: lobject.h:65
GCObject * finobj
Definition: lstate.h:242
#define cast(t, exp)
Definition: llimits.h:123
lu_byte gcstepsize
Definition: lstate.h:239
#define setnilvalue(obj)
Definition: lobject.h:178
#define G(L)
Definition: lstate.h:298
GCObject * tobefnz
Definition: lstate.h:248
#define h
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Definition: debugger.cpp:110
void luaC_freeallobjects(lua_State *L)
Definition: lgc.cpp:1503
#define lua_unlock(L)
Definition: llimits.h:254
#define NOCLOSINGMETH
Definition: lfunc.h:50
void luaE_freeCI(lua_State *L)
Definition: lstate.cpp:122
static void stack_init(lua_State *L1, lua_State *L)
Definition: lstate.cpp:180
static void close_state(lua_State *L)
Definition: lstate.cpp:272
lu_byte gcstepmul
Definition: lstate.h:238
#define fromstate(L)
Definition: lstate.cpp:51
#define unlikely(x)
Definition: llimits.h:162
lu_mem lastatomic
Definition: lstate.h:225
GCObject * allgc
Definition: lstate.h:240
static void f_luaopen(lua_State *L, void *ud)
Definition: lstate.cpp:235
#define LUA_RIDX_MAINTHREAD
Definition: lua.h:84
l_mem totalbytes
Definition: lstate.h:222
#define luaM_new(L, t)
Definition: lmem.h:59
StkId top
Definition: lstate.h:278
lu_byte gckind
Definition: lstate.h:232
StkId stack_last
Definition: lstate.h:281
long l_mem
Definition: llimits.h:31
#define sethvalue(L, obj, x)
Definition: lobject.h:661
#define lua_lock(L)
Definition: llimits.h:253
#define gettotalbytes(g)
Definition: lstate.h:351
void(* lua_WarnFunction)(void *ud, const char *msg, int tocont)
Definition: lua.h:131
unsigned char lu_byte
Definition: llimits.h:36
int nuse
Definition: lstate.h:152
void * ud
Definition: lstate.h:221
void luaH_resize(lua_State *L, Table *t, unsigned int newasize, unsigned int nhsize)
Definition: ltable.cpp:523
#define LUAI_GCPAUSE
Definition: lgc.h:129
struct lua_State * mainthread
Definition: lstate.h:260
void luaD_seterrorobj(lua_State *L, int errcode, StkId oldtop)
Definition: ldo.cpp:91
#define LUA_RIDX_LAST
Definition: lua.h:86
#define luai_userstateopen(L)
Definition: llimits.h:271
void *(* lua_Alloc)(void *ud, void *ptr, size_t osize, size_t nsize)
Definition: lua.h:125
CallInfo * ci
Definition: lstate.h:280
lua_CFunction panic
Definition: lstate.h:259
#define setgcparam(p, v)
Definition: lgc.h:136
#define ttisnil(v)
Definition: lobject.h:171
lu_byte extra_[LUA_EXTRASPACE]
Definition: lstate.cpp:36
#define luaM_newobject(L, tag, s)
Definition: lmem.h:64
void luaE_checkcstack(lua_State *L)
Definition: lstate.cpp:165
void luaT_init(lua_State *L)
Definition: ltm.cpp:38
lu_byte currentwhite
Definition: lstate.h:230
GCObject * finobjold1
Definition: lstate.h:256
#define api_incr_top(L)
Definition: lapi.h:16
LUA_API void lua_close(lua_State *L)
Definition: lstate.cpp:405
#define lua_getextraspace(L)
Definition: lua.h:359
void luaX_init(lua_State *L)
Definition: llex.cpp:70
l_uint32 nCcalls
Definition: lstate.h:290
global_State g
Definition: lstate.cpp:46
#define LUA_API
Definition: luaconf.h:277
volatile l_signalT hookmask
Definition: lstate.h:294
StkId func
Definition: lstate.h:161
#define LUAI_GCSTEPSIZE
Definition: lgc.h:141
#define luaM_free(L, b)
Definition: lmem.h:56
void * ud_warn
Definition: lstate.h:266
struct Table * mt[LUA_NUMTAGS]
Definition: lstate.h:263
#define LUAI_GENMAJORMUL
Definition: lgc.h:125
GCObject * finobjsur
Definition: lstate.h:255
#define resethookcount(L)
Definition: ldebug.h:21
CallInfo base_ci
Definition: lstate.h:287
static unsigned int luai_makeseed(lua_State *L)
Definition: lstate.cpp:71
static void init_registry(lua_State *L, global_State *g)
Definition: lstate.cpp:215
GCObject * weak
Definition: lstate.h:245
Table * luaH_new(lua_State *L)
Definition: ltable.cpp:596
GCObject * gray
Definition: lstate.h:243
l_noret luaD_throw(lua_State *L, int errcode)
Definition: ldo.cpp:114
#define UNUSED(x)
Definition: global.hpp:31
#define LUA_ERRERR
Definition: lua.h:54
void luaE_warnerror(lua_State *L, const char *where)
Definition: lstate.cpp:422
#define WHITE0BIT
Definition: lgc.h:75
#define lua_assert(c)
Definition: llimits.h:101
std::size_t i
Definition: function.cpp:941
static void freestack(lua_State *L)
Definition: lstate.cpp:202
TValue nilvalue
Definition: lstate.h:228
#define setthvalue2s(L, o, t)
Definition: lobject.h:251
int luaF_close(lua_State *L, StkId level, int status)
Definition: lfunc.cpp:223
struct CallInfo * next
Definition: lstate.h:163
mock_party p
#define setivalue(obj, x)
Definition: lobject.h:322
int oldpc
Definition: lstate.h:291
#define LUA_NUMTAGS
Definition: lua.h:415
int size
Definition: lstate.h:153
TString ** hash
Definition: lstate.h:151
GCObject ** sweepgc
Definition: lstate.h:241
double g
Definition: astarsearch.cpp:65
int lua_resetthread(lua_State *L)
Definition: lstate.cpp:327
short nresults
Definition: lstate.h:184
GCObject * survival
Definition: lstate.h:251
GCObject * grayagain
Definition: lstate.h:244
UpVal * openupval
Definition: lstate.h:283
GCObject * allweak
Definition: lstate.h:247
#define LUA_RIDX_GLOBALS
Definition: lua.h:85
#define MAX_LMEM
Definition: llimits.h:50
#define LUA_EXTRASPACE
Definition: luaconf.h:720
struct lua_State * twups
Definition: lstate.h:258
struct lua_State * twups
Definition: lstate.h:285
union CallInfo::@13 u
LUA_API lua_State * lua_newstate(lua_Alloc f, void *ud)
Definition: lstate.cpp:349
#define LUA_MINSTACK
Definition: lua.h:80
#define LUAI_MAXCCALLS
Definition: llimits.h:244
GCObject * firstold1
Definition: lstate.h:254
struct CallInfo::@13::@15 l
int luaD_rawrunprotected(lua_State *L, Pfunc f, void *ud)
Definition: ldo.cpp:141
#define addbuff(b, p, e)
Definition: lstate.cpp:67
GCObject * fixedgc
Definition: lstate.h:249
static void preinit_thread(lua_State *L, global_State *g)
Definition: lstate.cpp:253
void luaE_warning(lua_State *L, const char *msg, int tocont)
Definition: lstate.cpp:412
#define next(ls)
Definition: llex.cpp:32
GCObject * old1
Definition: lstate.h:252
unsigned int seed
Definition: lstate.h:229
#define f
struct CallInfo * previous
Definition: lstate.h:163
#define LUA_OK
Definition: lua.h:49
Definition: lstate.cpp:35
#define getCcalls(L)
Definition: lstate.h:102
#define LUAI_GENMINORMUL
Definition: lgc.h:126
#define bitmask(b)
Definition: lgc.h:63
stringtable strt
Definition: lstate.h:226
lu_byte gcstate
Definition: lstate.h:231
#define luaC_checkGC(L)
Definition: lgc.h:162
#define KGC_INC
Definition: lstate.h:146
#define svalue(o)
Definition: lobject.h:385
#define luai_userstatethread(L, L1)
Definition: llimits.h:279
LX l
Definition: lstate.cpp:45
#define setthvalue(L, obj, x)
Definition: lobject.h:246
LUAI_FUNC void luaE_incCstack(lua_State *L)
Definition: lstate.cpp:173
LUA_API lua_State * lua_newthread(lua_State *L)
Definition: lstate.cpp:285
lu_byte gcemergency
Definition: lstate.h:236
volatile lua_Hook hook
Definition: lstate.h:288
#define CIST_C
Definition: lstate.h:193
LUA_API int lua_setcstacklimit(lua_State *L, unsigned int limit)
Definition: lstate.cpp:99
#define stacksize(th)
Definition: lstate.h:142
GCObject * ephemeron
Definition: lstate.h:246
GCObject * reallyold
Definition: lstate.h:253
lu_byte gcrunning
Definition: lstate.h:235
#define LUAI_GCMUL
Definition: lgc.h:138
void luaH_setint(lua_State *L, Table *t, lua_Integer key, TValue *value)
Definition: ltable.cpp:784
lua_State l
Definition: lstate.cpp:37
#define BASIC_STACK_SIZE
Definition: lstate.h:140
GCObject * finobjrold
Definition: lstate.h:257
struct lua_longjmp * errorJmp
Definition: lstate.h:286
#define incnny(L)
Definition: lstate.h:106
void luaS_init(lua_State *L)
Definition: lstring.cpp:123
lu_byte status
Definition: lstate.h:275
#define EXTRA_STACK
Definition: lstate.h:137
TValue l_registry
Definition: lstate.h:227
#define luaC_white(g)
Definition: lgc.h:102
CallInfo * luaE_extendCI(lua_State *L)
Definition: lstate.cpp:105