lstate.c
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, 1);
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 */
89 void luaE_setdebt (global_State *g, l_mem debt) {
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  global_State *g = G(L);
101  int ccalls;
102  luaE_freeCI(L); /* release unused CIs */
103  ccalls = getCcalls(L);
104  if (limit >= 40000)
105  return 0; /* out of bounds */
106  limit += CSTACKERR;
107  if (L != g-> mainthread)
108  return 0; /* only main thread can change the C stack */
109  else if (ccalls <= CSTACKERR)
110  return 0; /* handling overflow */
111  else {
112  int diff = limit - g->Cstacklimit;
113  if (ccalls + diff <= CSTACKERR)
114  return 0; /* new limit would cause an overflow */
115  g->Cstacklimit = limit; /* set new limit */
116  L->nCcalls += diff; /* correct 'nCcalls' */
117  return limit - diff - CSTACKERR; /* success; return previous limit */
118  }
119 }
120 
121 
122 /*
123 ** Decrement count of "C calls" and check for overflows. In case of
124 ** a stack overflow, check appropriate error ("regular" overflow or
125 ** overflow while handling stack overflow). If 'nCcalls' is smaller
126 ** than CSTACKERR but larger than CSTACKMARK, it means it has just
127 ** entered the "overflow zone", so the function raises an overflow
128 ** error. If 'nCcalls' is smaller than CSTACKMARK (which means it is
129 ** already handling an overflow) but larger than CSTACKERRMARK, does
130 ** not report an error (to allow message handling to work). Otherwise,
131 ** report a stack overflow while handling a stack overflow (probably
132 ** caused by a repeating error in the message handling function).
133 */
134 
136  int ncalls = getCcalls(L);
137  L->nCcalls--;
138  if (ncalls <= CSTACKERR) { /* possible overflow? */
139  luaE_freeCI(L); /* release unused CIs */
140  ncalls = getCcalls(L); /* update call count */
141  if (ncalls <= CSTACKERR) { /* still overflow? */
142  if (ncalls <= CSTACKERRMARK) /* below error-handling zone? */
143  luaD_throw(L, LUA_ERRERR); /* error while handling stack error */
144  else if (ncalls >= CSTACKMARK) {
145  /* not in error-handling zone; raise the error now */
146  L->nCcalls = (CSTACKMARK - 1); /* enter error-handling zone */
147  luaG_runerror(L, "C stack overflow");
148  }
149  /* else stack is in the error-handling zone;
150  allow message handler to work */
151  }
152  }
153 }
154 
155 
157  CallInfo *ci;
158  lua_assert(L->ci->next == NULL);
159  luaE_enterCcall(L);
160  ci = luaM_new(L, CallInfo);
161  lua_assert(L->ci->next == NULL);
162  L->ci->next = ci;
163  ci->previous = L->ci;
164  ci->next = NULL;
165  ci->u.l.trap = 0;
166  L->nci++;
167  return ci;
168 }
169 
170 
171 /*
172 ** free all CallInfo structures not in use by a thread
173 */
175  CallInfo *ci = L->ci;
176  CallInfo *next = ci->next;
177  ci->next = NULL;
178  L->nCcalls += L->nci; /* add removed elements back to 'nCcalls' */
179  while ((ci = next) != NULL) {
180  next = ci->next;
181  luaM_free(L, ci);
182  L->nci--;
183  }
184  L->nCcalls -= L->nci; /* adjust result */
185 }
186 
187 
188 /*
189 ** free half of the CallInfo structures not in use by a thread,
190 ** keeping the first one.
191 */
193  CallInfo *ci = L->ci->next; /* first free CallInfo */
194  CallInfo *next;
195  if (ci == NULL)
196  return; /* no extra elements */
197  L->nCcalls += L->nci; /* add removed elements back to 'nCcalls' */
198  while ((next = ci->next) != NULL) { /* two extra elements? */
199  CallInfo *next2 = next->next; /* next's next */
200  ci->next = next2; /* remove next from the list */
201  L->nci--;
202  luaM_free(L, next); /* free next */
203  if (next2 == NULL)
204  break; /* no more elements */
205  else {
206  next2->previous = ci;
207  ci = next2; /* continue */
208  }
209  }
210  L->nCcalls -= L->nci; /* adjust result */
211 }
212 
213 
214 static void stack_init (lua_State *L1, lua_State *L) {
215  int i; CallInfo *ci;
216  /* initialize stack array */
219  for (i = 0; i < BASIC_STACK_SIZE; i++)
220  setnilvalue(s2v(L1->stack + i)); /* erase new stack */
221  L1->top = L1->stack;
222  L1->stack_last = L1->stack + L1->stacksize - EXTRA_STACK;
223  /* initialize first ci */
224  ci = &L1->base_ci;
225  ci->next = ci->previous = NULL;
226  ci->callstatus = CIST_C;
227  ci->func = L1->top;
228  ci->u.c.k = NULL;
229  ci->nresults = 0;
230  setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */
231  L1->top++;
232  ci->top = L1->top + LUA_MINSTACK;
233  L1->ci = ci;
234 }
235 
236 
237 static void freestack (lua_State *L) {
238  if (L->stack == NULL)
239  return; /* stack not completely built yet */
240  L->ci = &L->base_ci; /* free the entire 'ci' list */
241  luaE_freeCI(L);
242  lua_assert(L->nci == 0);
243  luaM_freearray(L, L->stack, L->stacksize); /* free stack array */
244 }
245 
246 
247 /*
248 ** Create registry table and its predefined values
249 */
250 static void init_registry (lua_State *L, global_State *g) {
251  TValue temp;
252  /* create registry */
253  Table *registry = luaH_new(L);
254  sethvalue(L, &g->l_registry, registry);
255  luaH_resize(L, registry, LUA_RIDX_LAST, 0);
256  /* registry[LUA_RIDX_MAINTHREAD] = L */
257  setthvalue(L, &temp, L); /* temp = L */
258  luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &temp);
259  /* registry[LUA_RIDX_GLOBALS] = table of globals */
260  sethvalue(L, &temp, luaH_new(L)); /* temp = new table (global table) */
261  luaH_setint(L, registry, LUA_RIDX_GLOBALS, &temp);
262 }
263 
264 
265 /*
266 ** open parts of the state that may cause memory-allocation errors.
267 ** ('g->nilvalue' being a nil value flags that the state was completely
268 ** build.)
269 */
270 static void f_luaopen (lua_State *L, void *ud) {
271  global_State *g = G(L);
272  UNUSED(ud);
273  stack_init(L, L); /* init stack */
274  init_registry(L, g);
275  luaS_init(L);
276  luaT_init(L);
277  luaX_init(L);
278  g->gcrunning = 1; /* allow gc */
279  setnilvalue(&g->nilvalue);
281 }
282 
283 
284 /*
285 ** preinitialize a thread with consistent values without allocating
286 ** any memory (to avoid errors)
287 */
288 static void preinit_thread (lua_State *L, global_State *g) {
289  G(L) = g;
290  L->stack = NULL;
291  L->ci = NULL;
292  L->nci = 0;
293  L->stacksize = 0;
294  L->twups = L; /* thread has no upvalues */
295  L->errorJmp = NULL;
296  L->hook = NULL;
297  L->hookmask = 0;
298  L->basehookcount = 0;
299  L->allowhook = 1;
300  resethookcount(L);
301  L->openupval = NULL;
302  L->status = LUA_OK;
303  L->errfunc = 0;
304  L->oldpc = 0;
305 }
306 
307 
308 static void close_state (lua_State *L) {
309  global_State *g = G(L);
310  luaF_close(L, L->stack, CLOSEPROTECT); /* close all upvalues */
311  luaC_freeallobjects(L); /* collect all objects */
312  if (ttisnil(&g->nilvalue)) /* closing a fully built state? */
314  luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size);
315  freestack(L);
316  lua_assert(gettotalbytes(g) == sizeof(LG));
317  (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */
318 }
319 
320 
322  global_State *g;
323  lua_State *L1;
324  lua_lock(L);
325  g = G(L);
326  luaC_checkGC(L);
327  /* create new thread */
328  L1 = &cast(LX *, luaM_newobject(L, LUA_TTHREAD, sizeof(LX)))->l;
329  L1->marked = luaC_white(g);
330  L1->tt = LUA_VTHREAD;
331  /* link it on list 'allgc' */
332  L1->next = g->allgc;
333  g->allgc = obj2gco(L1);
334  /* anchor it on L stack */
335  setthvalue2s(L, L->top, L1);
336  api_incr_top(L);
337  preinit_thread(L1, g);
338  L1->nCcalls = getCcalls(L);
339  L1->hookmask = L->hookmask;
340  L1->basehookcount = L->basehookcount;
341  L1->hook = L->hook;
342  resethookcount(L1);
343  /* initialize L1 extra space */
346  luai_userstatethread(L, L1);
347  stack_init(L1, L); /* init stack */
348  lua_unlock(L);
349  return L1;
350 }
351 
352 
354  LX *l = fromstate(L1);
355  luaF_close(L1, L1->stack, NOCLOSINGMETH); /* close all upvalues */
356  lua_assert(L1->openupval == NULL);
357  luai_userstatefree(L, L1);
358  freestack(L1);
359  luaM_free(L, l);
360 }
361 
362 
364  CallInfo *ci;
365  int status;
366  lua_lock(L);
367  L->ci = ci = &L->base_ci; /* unwind CallInfo list */
368  setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */
369  ci->func = L->stack;
370  ci->callstatus = CIST_C;
371  status = luaF_close(L, L->stack, CLOSEPROTECT);
372  if (status != CLOSEPROTECT) /* real errors? */
373  luaD_seterrorobj(L, status, L->stack + 1);
374  else {
375  status = LUA_OK;
376  L->top = L->stack + 1;
377  }
378  ci->top = L->top + LUA_MINSTACK;
379  L->status = status;
380  lua_unlock(L);
381  return status;
382 }
383 
384 
386  int i;
387  lua_State *L;
388  global_State *g;
389  LG *l = cast(LG *, (*f)(ud, NULL, LUA_TTHREAD, sizeof(LG)));
390  if (l == NULL) return NULL;
391  L = &l->l.l;
392  g = &l->g;
393  L->tt = LUA_VTHREAD;
395  L->marked = luaC_white(g);
396  preinit_thread(L, g);
397  g->allgc = obj2gco(L); /* by now, only object is the main thread */
398  L->next = NULL;
400  incnny(L); /* main thread is always non yieldable */
401  g->frealloc = f;
402  g->ud = ud;
403  g->warnf = NULL;
404  g->ud_warn = NULL;
405  g->mainthread = L;
406  g->seed = luai_makeseed(L);
407  g->gcrunning = 0; /* no GC while building state */
408  g->strt.size = g->strt.nuse = 0;
409  g->strt.hash = NULL;
410  setnilvalue(&g->l_registry);
411  g->panic = NULL;
412  g->gcstate = GCSpause;
413  g->gckind = KGC_INC;
414  g->gcemergency = 0;
415  g->finobj = g->tobefnz = g->fixedgc = NULL;
416  g->firstold1 = g->survival = g->old1 = g->reallyold = NULL;
417  g->finobjsur = g->finobjold1 = g->finobjrold = NULL;
418  g->sweepgc = NULL;
419  g->gray = g->grayagain = NULL;
420  g->weak = g->ephemeron = g->allweak = NULL;
421  g->twups = NULL;
422  g->totalbytes = sizeof(LG);
423  g->GCdebt = 0;
424  g->lastatomic = 0;
425  setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */
431  for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL;
432  if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) {
433  /* memory allocation error: free partial state */
434  close_state(L);
435  L = NULL;
436  }
437  return L;
438 }
439 
440 
442  lua_lock(L);
443  L = G(L)->mainthread; /* only the main thread can be closed */
444  close_state(L);
445 }
446 
447 
448 void luaE_warning (lua_State *L, const char *msg, int tocont) {
449  lua_WarnFunction wf = G(L)->warnf;
450  if (wf != NULL)
451  wf(G(L)->ud_warn, msg, tocont);
452 }
453 
454 
455 /*
456 ** Generate a warning from an error message
457 */
458 void luaE_warnerror (lua_State *L, const char *where) {
459  TValue *errobj = s2v(L->top - 1); /* error object */
460  const char *msg = (ttisstring(errobj))
461  ? svalue(errobj)
462  : "error object is not a string";
463  /* produce warning "error in %s (%s)" (where, msg) */
464  luaE_warning(L, "error in ", 1);
465  luaE_warning(L, where, 1);
466  luaE_warning(L, " (", 1);
467  luaE_warning(L, msg, 1);
468  luaE_warning(L, ")", 0);
469 }
470 
lu_byte genmajormul
Definition: lstate.h:266
static void freestack(lua_State *L)
Definition: lstate.c:237
unsigned short callstatus
Definition: lstate.h:218
lu_byte allowhook
Definition: lstate.h:309
void luaX_init(lua_State *L)
Definition: llex.c:70
#define LUA_TTHREAD
Definition: lua.h:73
l_mem GCdebt
Definition: lstate.h:255
ptrdiff_t errfunc
Definition: lstate.h:322
#define luai_userstateclose(L)
Definition: llimits.h:264
Definition: lstate.c:44
void luaE_warnerror(lua_State *L, const char *where)
Definition: lstate.c:458
#define luai_userstatefree(L, L1)
Definition: llimits.h:272
#define LUA_VTHREAD
Definition: lobject.h:238
#define LUAI_MAXCSTACK
Definition: ltests.h:29
#define luaM_newvector(L, n, t)
Definition: lmem.h:60
int lua_resetthread(lua_State *L)
Definition: lstate.c:363
#define s2v(o)
Definition: lobject.h:148
Definition: lobject.h:712
int luaF_close(lua_State *L, StkId level, int status)
Definition: lfunc.c:223
#define obj2gco(v)
Definition: lstate.h:381
#define CSTACKMARK
Definition: lstate.h:126
#define luaM_freearray(L, b, n)
Definition: lmem.h:57
StkId stack
Definition: lstate.h:315
lu_byte gcpause
Definition: lstate.h:269
#define ttisstring(o)
Definition: lobject.h:339
lu_byte genminormul
Definition: lstate.h:265
#define GCSpause
Definition: lgc.h:39
lua_Alloc frealloc
Definition: lstate.h:252
#define CLOSEPROTECT
Definition: lfunc.h:53
lua_WarnFunction warnf
Definition: lstate.h:297
void luaE_freeCI(lua_State *L)
Definition: lstate.c:174
unsigned short nci
Definition: lstate.h:310
struct LG LG
#define UNUSED(x)
Definition: llimits.h:118
int basehookcount
Definition: lstate.h:326
#define cast_uint(i)
Definition: llimits.h:129
StkId top
Definition: lstate.h:195
Definition: lobject.h:63
GCObject * finobj
Definition: lstate.h:274
#define cast(t, exp)
Definition: llimits.h:123
lu_byte gcstepsize
Definition: lstate.h:271
LUA_API lua_State * lua_newstate(lua_Alloc f, void *ud)
Definition: lstate.c:385
#define setnilvalue(obj)
Definition: lobject.h:176
CallInfo * luaE_extendCI(lua_State *L)
Definition: lstate.c:156
#define G(L)
Definition: lstate.h:332
GCObject * tobefnz
Definition: lstate.h:280
#define lua_unlock(L)
Definition: llimits.h:243
struct CallInfo::@30::@33 c
static unsigned int luai_makeseed(lua_State *L)
Definition: lstate.c:71
void luaE_shrinkCI(lua_State *L)
Definition: lstate.c:192
#define NOCLOSINGMETH
Definition: lfunc.h:50
lu_byte gcstepmul
Definition: lstate.h:270
lu_mem lastatomic
Definition: lstate.h:257
GCObject * allgc
Definition: lstate.h:272
#define LUA_EXTRASPACE
Definition: ltests.h:89
#define LUA_RIDX_MAINTHREAD
Definition: lua.h:84
l_mem totalbytes
Definition: lstate.h:254
#define luaM_new(L, t)
Definition: lmem.h:59
StkId top
Definition: lstate.h:311
lu_byte gckind
Definition: lstate.h:264
StkId stack_last
Definition: lstate.h:314
long l_mem
Definition: llimits.h:31
#define sethvalue(L, obj, x)
Definition: lobject.h:659
#define lua_lock(L)
Definition: llimits.h:242
#define gettotalbytes(g)
Definition: lstate.h:385
static void init_registry(lua_State *L, global_State *g)
Definition: lstate.c:250
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:185
void * ud
Definition: lstate.h:253
static void preinit_thread(lua_State *L, global_State *g)
Definition: lstate.c:288
#define LUAI_GCPAUSE
Definition: lgc.h:129
struct lua_State * mainthread
Definition: lstate.h:292
static void f_luaopen(lua_State *L, void *ud)
Definition: lstate.c:270
#define LUA_RIDX_LAST
Definition: lua.h:86
void luaH_resize(lua_State *L, Table *t, unsigned int newasize, unsigned int nhsize)
Definition: ltable.c:509
void luaD_seterrorobj(lua_State *L, int errcode, StkId oldtop)
Definition: ldo.c:91
#define luai_userstateopen(L)
Definition: llimits.h:260
void *(* lua_Alloc)(void *ud, void *ptr, size_t osize, size_t nsize)
Definition: lua.h:125
CallInfo * ci
Definition: lstate.h:313
lua_CFunction panic
Definition: lstate.h:291
#define setgcparam(p, v)
Definition: lgc.h:136
#define ttisnil(v)
Definition: lobject.h:169
lu_byte extra_[LUA_EXTRASPACE]
Definition: lstate.c:36
#define luaM_newobject(L, tag, s)
Definition: lmem.h:64
#define fromstate(L)
Definition: lstate.c:51
lu_byte currentwhite
Definition: lstate.h:262
GCObject * finobjold1
Definition: lstate.h:288
#define api_incr_top(L)
Definition: lapi.h:16
#define CSTACKERRMARK
Definition: lstate.h:127
#define lua_getextraspace(L)
Definition: lua.h:359
l_uint32 nCcalls
Definition: lstate.h:323
#define next(ls)
Definition: llex.c:32
global_State g
Definition: lstate.c:46
#define LUA_API
Definition: luaconf.h:292
LUA_API void lua_close(lua_State *L)
Definition: lstate.c:441
volatile l_signalT hookmask
Definition: lstate.h:328
StkId func
Definition: lstate.h:194
#define LUAI_GCSTEPSIZE
Definition: lgc.h:141
#define luaM_free(L, b)
Definition: lmem.h:56
void * ud_warn
Definition: lstate.h:298
l_noret luaG_runerror(lua_State *L, const char *fmt,...)
Definition: ldebug.c:767
struct Table * mt[LUA_NUMTAGS]
Definition: lstate.h:295
#define LUAI_GENMAJORMUL
Definition: lgc.h:125
Table * luaH_new(lua_State *L)
Definition: ltable.c:582
void luaE_warning(lua_State *L, const char *msg, int tocont)
Definition: lstate.c:448
GCObject * finobjsur
Definition: lstate.h:287
#define resethookcount(L)
Definition: ldebug.h:21
CallInfo base_ci
Definition: lstate.h:320
GCObject * weak
Definition: lstate.h:277
void luaE_enterCcall(lua_State *L)
Definition: lstate.c:135
GCObject * gray
Definition: lstate.h:275
#define CSTACKERR
Definition: lstate.h:125
#define LUA_ERRERR
Definition: lua.h:54
int luaD_rawrunprotected(lua_State *L, Pfunc f, void *ud)
Definition: ldo.c:141
#define WHITE0BIT
Definition: lgc.h:75
#define lua_assert(c)
Definition: llimits.h:101
TValue nilvalue
Definition: lstate.h:260
#define setthvalue2s(L, o, t)
Definition: lobject.h:249
void luaE_setdebt(global_State *g, l_mem debt)
Definition: lstate.c:89
struct CallInfo * next
Definition: lstate.h:196
void luaS_init(lua_State *L)
Definition: lstring.c:135
#define setivalue(obj, x)
Definition: lobject.h:320
int oldpc
Definition: lstate.h:324
#define LUA_NUMTAGS
Definition: lua.h:415
int size
Definition: lstate.h:186
TString ** hash
Definition: lstate.h:184
GCObject ** sweepgc
Definition: lstate.h:273
short nresults
Definition: lstate.h:217
GCObject * survival
Definition: lstate.h:283
GCObject * grayagain
Definition: lstate.h:276
UpVal * openupval
Definition: lstate.h:316
GCObject * allweak
Definition: lstate.h:279
static void close_state(lua_State *L)
Definition: lstate.c:308
#define LUA_RIDX_GLOBALS
Definition: lua.h:85
#define MAX_LMEM
Definition: llimits.h:50
struct lua_State * twups
Definition: lstate.h:290
struct lua_State * twups
Definition: lstate.h:318
#define LUA_MINSTACK
Definition: lua.h:80
float time
Definition: mqtt_test.py:17
GCObject * firstold1
Definition: lstate.h:286
void luaC_freeallobjects(lua_State *L)
Definition: lgc.c:1497
GCObject * fixedgc
Definition: lstate.h:281
LUA_API lua_State * lua_newthread(lua_State *L)
Definition: lstate.c:321
#define addbuff(b, p, e)
Definition: lstate.c:67
void luaE_freethread(lua_State *L, lua_State *L1)
Definition: lstate.c:353
union CallInfo::@30 u
void luaT_init(lua_State *L)
Definition: ltm.c:38
void luaH_setint(lua_State *L, Table *t, lua_Integer key, TValue *value)
Definition: ltable.c:770
unsigned int Cstacklimit
Definition: lstate.h:299
GCObject * old1
Definition: lstate.h:284
unsigned int luaS_hash(const char *str, size_t l, unsigned int seed, size_t step)
Definition: lstring.c:53
unsigned int seed
Definition: lstate.h:261
struct CallInfo * previous
Definition: lstate.h:196
#define LUA_OK
Definition: lua.h:49
Definition: lstate.c:35
#define getCcalls(L)
Definition: lstate.h:138
#define LUAI_GENMINORMUL
Definition: lgc.h:126
#define bitmask(b)
Definition: lgc.h:63
stringtable strt
Definition: lstate.h:258
lu_byte gcstate
Definition: lstate.h:263
#define luaC_checkGC(L)
Definition: lgc.h:162
int stacksize
Definition: lstate.h:325
#define KGC_INC
Definition: lstate.h:179
#define svalue(o)
Definition: lobject.h:383
#define luai_userstatethread(L, L1)
Definition: llimits.h:268
LX l
Definition: lstate.c:45
#define setthvalue(L, obj, x)
Definition: lobject.h:244
LUA_API int lua_setcstacklimit(lua_State *L, unsigned int limit)
Definition: lstate.c:99
lu_byte gcemergency
Definition: lstate.h:268
volatile lua_Hook hook
Definition: lstate.h:321
#define CIST_C
Definition: lstate.h:226
static void stack_init(lua_State *L1, lua_State *L)
Definition: lstate.c:214
GCObject * ephemeron
Definition: lstate.h:278
struct LX LX
GCObject * reallyold
Definition: lstate.h:285
lu_byte gcrunning
Definition: lstate.h:267
#define LUAI_GCMUL
Definition: lgc.h:138
lua_State l
Definition: lstate.c:37
l_noret luaD_throw(lua_State *L, int errcode)
Definition: ldo.c:114
#define BASIC_STACK_SIZE
Definition: lstate.h:175
GCObject * finobjrold
Definition: lstate.h:289
struct lua_longjmp * errorJmp
Definition: lstate.h:319
#define incnny(L)
Definition: lstate.h:142
struct CallInfo::@30::@32 l
lu_byte status
Definition: lstate.h:308
#define EXTRA_STACK
Definition: lstate.h:172
TValue l_registry
Definition: lstate.h:259
#define luaC_white(g)
Definition: lgc.h:102


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:09