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);
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  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 (l_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  L1->tbclist = L1->stack;
185  for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
186  setnilvalue(s2v(L1->stack + i)); /* erase new stack */
187  L1->top = L1->stack;
188  L1->stack_last = L1->stack + BASIC_STACK_SIZE;
189  /* initialize first ci */
190  ci = &L1->base_ci;
191  ci->next = ci->previous = NULL;
192  ci->callstatus = CIST_C;
193  ci->func = L1->top;
194  ci->u.c.k = NULL;
195  ci->nresults = 0;
196  setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */
197  L1->top++;
198  ci->top = L1->top + LUA_MINSTACK;
199  L1->ci = ci;
200 }
201 
202 
203 static void freestack (lua_State *L) {
204  if (L->stack == NULL)
205  return; /* stack not completely built yet */
206  L->ci = &L->base_ci; /* free the entire 'ci' list */
207  luaE_freeCI(L);
208  lua_assert(L->nci == 0);
209  luaM_freearray(L, L->stack, stacksize(L) + EXTRA_STACK); /* free stack */
210 }
211 
212 
213 /*
214 ** Create registry table and its predefined values
215 */
216 static void init_registry (lua_State *L, global_State *g) {
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, &registry->array[LUA_RIDX_MAINTHREAD - 1], L);
223  /* registry[LUA_RIDX_GLOBALS] = new table (table of globals) */
224  sethvalue(L, &registry->array[LUA_RIDX_GLOBALS - 1], luaH_new(L));
225 }
226 
227 
228 /*
229 ** open parts of the state that may cause memory-allocation errors.
230 */
231 static void f_luaopen (lua_State *L, void *ud) {
232  global_State *g = G(L);
233  UNUSED(ud);
234  stack_init(L, L); /* init stack */
235  init_registry(L, g);
236  luaS_init(L);
237  luaT_init(L);
238  luaX_init(L);
239  g->gcrunning = 1; /* allow gc */
240  setnilvalue(&g->nilvalue); /* now state is complete */
242 }
243 
244 
245 /*
246 ** preinitialize a thread with consistent values without allocating
247 ** any memory (to avoid errors)
248 */
249 static void preinit_thread (lua_State *L, global_State *g) {
250  G(L) = g;
251  L->stack = NULL;
252  L->ci = NULL;
253  L->nci = 0;
254  L->twups = L; /* thread has no upvalues */
255  L->nCcalls = 0;
256  L->errorJmp = NULL;
257  L->hook = NULL;
258  L->hookmask = 0;
259  L->basehookcount = 0;
260  L->allowhook = 1;
261  resethookcount(L);
262  L->openupval = NULL;
263  L->status = LUA_OK;
264  L->errfunc = 0;
265  L->oldpc = 0;
266 }
267 
268 
269 static void close_state (lua_State *L) {
270  global_State *g = G(L);
271  if (!completestate(g)) /* closing a partially built state? */
272  luaC_freeallobjects(L); /* jucst collect its objects */
273  else { /* closing a fully built state */
274  luaD_closeprotected(L, 1, LUA_OK); /* close all upvalues */
275  luaC_freeallobjects(L); /* collect all objects */
277  }
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->hookmask = L->hookmask;
303  L1->basehookcount = L->basehookcount;
304  L1->hook = L->hook;
305  resethookcount(L1);
306  /* initialize L1 extra space */
309  luai_userstatethread(L, L1);
310  stack_init(L1, L); /* init stack */
311  lua_unlock(L);
312  return L1;
313 }
314 
315 
317  LX *l = fromstate(L1);
318  luaF_closeupval(L1, L1->stack); /* close all upvalues */
319  lua_assert(L1->openupval == NULL);
320  luai_userstatefree(L, L1);
321  freestack(L1);
322  luaM_free(L, l);
323 }
324 
325 
326 int luaE_resetthread (lua_State *L, int status) {
327  CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */
328  setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */
329  ci->func = L->stack;
330  ci->callstatus = CIST_C;
331  if (status == LUA_YIELD)
332  status = LUA_OK;
333  status = luaD_closeprotected(L, 1, status);
334  if (status != LUA_OK) /* errors? */
335  luaD_seterrorobj(L, status, L->stack + 1);
336  else
337  L->top = L->stack + 1;
338  ci->top = L->top + LUA_MINSTACK;
339  L->status = cast_byte(status);
340  luaD_reallocstack(L, cast_int(ci->top - L->stack), 0);
341  return status;
342 }
343 
344 
346  int status;
347  lua_lock(L);
348  status = luaE_resetthread(L, L->status);
349  lua_unlock(L);
350  return status;
351 }
352 
353 
355  int i;
356  lua_State *L;
357  global_State *g;
358  LG *l = cast(LG *, (*f)(ud, NULL, LUA_TTHREAD, sizeof(LG)));
359  if (l == NULL) return NULL;
360  L = &l->l.l;
361  g = &l->g;
362  L->tt = LUA_VTHREAD;
364  L->marked = luaC_white(g);
365  preinit_thread(L, g);
366  g->allgc = obj2gco(L); /* by now, only object is the main thread */
367  L->next = NULL;
368  incnny(L); /* main thread is always non yieldable */
369  g->frealloc = f;
370  g->ud = ud;
371  g->warnf = NULL;
372  g->ud_warn = NULL;
373  g->mainthread = L;
374  g->seed = luai_makeseed(L);
375  g->gcrunning = 0; /* no GC while building state */
376  g->strt.size = g->strt.nuse = 0;
377  g->strt.hash = NULL;
378  setnilvalue(&g->l_registry);
379  g->panic = NULL;
380  g->gcstate = GCSpause;
381  g->gckind = KGC_INC;
382  g->gcstopem = 0;
383  g->gcemergency = 0;
384  g->finobj = g->tobefnz = g->fixedgc = NULL;
385  g->firstold1 = g->survival = g->old1 = g->reallyold = NULL;
386  g->finobjsur = g->finobjold1 = g->finobjrold = NULL;
387  g->sweepgc = NULL;
388  g->gray = g->grayagain = NULL;
389  g->weak = g->ephemeron = g->allweak = NULL;
390  g->twups = NULL;
391  g->totalbytes = sizeof(LG);
392  g->GCdebt = 0;
393  g->lastatomic = 0;
394  setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */
400  for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL;
401  if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) {
402  /* memory allocation error: free partial state */
403  close_state(L);
404  L = NULL;
405  }
406  return L;
407 }
408 
409 
411  lua_lock(L);
412  L = G(L)->mainthread; /* only the main thread can be closed */
413  close_state(L);
414 }
415 
416 
417 void luaE_warning (lua_State *L, const char *msg, int tocont) {
418  lua_WarnFunction wf = G(L)->warnf;
419  if (wf != NULL)
420  wf(G(L)->ud_warn, msg, tocont);
421 }
422 
423 
424 /*
425 ** Generate a warning from an error message
426 */
427 void luaE_warnerror (lua_State *L, const char *where) {
428  TValue *errobj = s2v(L->top - 1); /* error object */
429  const char *msg = (ttisstring(errobj))
430  ? svalue(errobj)
431  : "error object is not a string";
432  /* produce warning "error in %s (%s)" (where, msg) */
433  luaE_warning(L, "error in ", 1);
434  luaE_warning(L, where, 1);
435  luaE_warning(L, " (", 1);
436  luaE_warning(L, msg, 1);
437  luaE_warning(L, ")", 0);
438 }
439 
LUA_VTHREAD
#define LUA_VTHREAD
Definition: lobject.h:249
luaT_init
void luaT_init(lua_State *L)
Definition: ltm.c:38
luai_makeseed
static unsigned int luai_makeseed(lua_State *L)
Definition: lstate.c:71
luaE_warnerror
void luaE_warnerror(lua_State *L, const char *where)
Definition: lstate.c:427
lua_State::errorJmp
struct lua_longjmp * errorJmp
Definition: lstate.h:318
EXTRA_STACK
#define EXTRA_STACK
Definition: lstate.h:137
s2v
#define s2v(o)
Definition: lobject.h:159
BASIC_STACK_SIZE
#define BASIC_STACK_SIZE
Definition: lstate.h:140
resethookcount
#define resethookcount(L)
Definition: ldebug.h:21
CallInfo::u
union CallInfo::@12 u
luaE_incCstack
LUAI_FUNC void luaE_incCstack(lua_State *L)
Definition: lstate.c:173
CallInfo::previous
struct CallInfo * previous
Definition: lstate.h:175
lua_assert
#define lua_assert(c)
Definition: lauxlib.h:170
setthvalue
#define setthvalue(L, obj, x)
Definition: lobject.h:255
global_State::gcpause
lu_byte gcpause
Definition: lstate.h:268
luaS_init
void luaS_init(lua_State *L)
Definition: lstring.c:123
LUAI_FUNC
#define LUAI_FUNC
Definition: luaconf.h:312
CallInfo::nresults
short nresults
Definition: lstate.h:197
cast_byte
#define cast_byte(i)
Definition: llimits.h:130
cast
#define cast(t, exp)
Definition: llimits.h:123
global_State::ud_warn
void * ud_warn
Definition: lstate.h:297
global_State::weak
GCObject * weak
Definition: lstate.h:276
lua_State::errfunc
ptrdiff_t errfunc
Definition: lstate.h:321
LUA_RIDX_LAST
#define LUA_RIDX_LAST
Definition: lua.h:86
lua_State::stack
StkId stack
Definition: lstate.h:313
LUA_NUMTAGS
#define LUA_NUMTAGS
Definition: lua.h:416
lstate.h
LUA_RIDX_MAINTHREAD
#define LUA_RIDX_MAINTHREAD
Definition: lua.h:84
global_State::genmajormul
lu_byte genmajormul
Definition: lstate.h:265
bitmask
#define bitmask(b)
Definition: lgc.h:63
LUA_MINSTACK
#define LUA_MINSTACK
Definition: lua.h:80
LUA_OK
#define LUA_OK
Definition: lua.h:49
luai_userstatefree
#define luai_userstatefree(L, L1)
Definition: llimits.h:267
CallInfo::next
struct CallInfo * next
Definition: lstate.h:175
nonstd::span_lite::size_t
span_CONFIG_SIZE_TYPE size_t
Definition: span.hpp:576
lua_State::status
lu_byte status
Definition: lstate.h:306
freestack
static void freestack(lua_State *L)
Definition: lstate.c:203
api_incr_top
#define api_incr_top(L)
Definition: lapi.h:16
CallInfo::func
StkId func
Definition: lstate.h:173
StackValue
Definition: lobject.h:146
LG
Definition: lstate.c:44
lua_State::tbclist
StkId tbclist
Definition: lstate.h:315
LUA_ERRERR
#define LUA_ERRERR
Definition: lua.h:54
ltable.h
luaC_checkGC
#define luaC_checkGC(L)
Definition: lgc.h:162
Table::array
TValue * array
Definition: lobject.h:729
lua_unlock
#define lua_unlock(L)
Definition: llimits.h:238
time.h
stringtable::hash
TString ** hash
Definition: lstate.h:151
completestate
#define completestate(g)
Definition: lstate.h:336
lua_State::top
StkId top
Definition: lstate.h:309
lua_State::stack_last
StkId stack_last
Definition: lstate.h:312
luaG_runerror
l_noret luaG_runerror(lua_State *L, const char *fmt,...)
Definition: ldebug.c:778
sethvalue
#define sethvalue(L, obj, x)
Definition: lobject.h:671
global_State::finobjold1
GCObject * finobjold1
Definition: lstate.h:287
global_State::gcrunning
lu_byte gcrunning
Definition: lstate.h:266
obj2gco
#define obj2gco(v)
Definition: lstate.h:385
lua_State::nci
unsigned short nci
Definition: lstate.h:308
lua_State::basehookcount
int basehookcount
Definition: lstate.h:324
incnny
#define incnny(L)
Definition: lstate.h:106
CallInfo::top
StkId top
Definition: lstate.h:174
global_State::seed
unsigned int seed
Definition: lstate.h:259
global_State::tobefnz
GCObject * tobefnz
Definition: lstate.h:279
cast_uint
#define cast_uint(i)
Definition: llimits.h:129
global_State::old1
GCObject * old1
Definition: lstate.h:283
llex.h
f_luaopen
static void f_luaopen(lua_State *L, void *ud)
Definition: lstate.c:231
luaF_closeupval
void luaF_closeupval(lua_State *L, StkId level)
Definition: lfunc.c:194
global_State::fixedgc
GCObject * fixedgc
Definition: lstate.h:280
ltm.h
mqtt_test_proto.msg
msg
Definition: mqtt_test_proto.py:43
global_State::gray
GCObject * gray
Definition: lstate.h:274
global_State::l_registry
TValue l_registry
Definition: lstate.h:257
global_State::grayagain
GCObject * grayagain
Definition: lstate.h:275
luaM_newvector
#define luaM_newvector(L, n, t)
Definition: lmem.h:60
global_State::allweak
GCObject * allweak
Definition: lstate.h:278
luaE_checkcstack
void luaE_checkcstack(lua_State *L)
Definition: lstate.c:165
global_State::twups
struct lua_State * twups
Definition: lstate.h:289
f
f
LUA_TTHREAD
#define LUA_TTHREAD
Definition: lua.h:73
UNUSED
#define UNUSED(x)
Definition: llimits.h:118
LX::extra_
lu_byte extra_[LUA_EXTRASPACE]
Definition: lstate.c:36
luaH_resize
void luaH_resize(lua_State *L, Table *t, unsigned int newasize, unsigned int nhsize)
Definition: ltable.c:542
LX
struct LX LX
setnilvalue
#define setnilvalue(obj)
Definition: lobject.h:187
global_State::gckind
lu_byte gckind
Definition: lstate.h:262
CallInfo::callstatus
unsigned short callstatus
Definition: lstate.h:198
GCSpause
#define GCSpause
Definition: lgc.h:39
lua_Alloc
void *(* lua_Alloc)(void *ud, void *ptr, size_t osize, size_t nsize)
Definition: lua.h:125
luai_userstateopen
#define luai_userstateopen(L)
Definition: llimits.h:255
lua.h
luaD_reallocstack
int luaD_reallocstack(lua_State *L, int newsize, int raiseerror)
Definition: ldo.c:191
luaC_white
#define luaC_white(g)
Definition: lgc.h:102
LX::l
lua_State l
Definition: lstate.c:37
global_State::reallyold
GCObject * reallyold
Definition: lstate.h:284
WHITE0BIT
#define WHITE0BIT
Definition: lgc.h:75
global_State::mainthread
struct lua_State * mainthread
Definition: lstate.h:291
global_State::nilvalue
TValue nilvalue
Definition: lstate.h:258
fromstate
#define fromstate(L)
Definition: lstate.c:51
luaE_setdebt
void luaE_setdebt(global_State *g, l_mem debt)
Definition: lstate.c:89
l_mem
long l_mem
Definition: llimits.h:31
global_State::panic
lua_CFunction panic
Definition: lstate.h:290
global_State::lastatomic
lu_mem lastatomic
Definition: lstate.h:255
global_State::strt
stringtable strt
Definition: lstate.h:256
CallInfo::c
struct CallInfo::@12::@15 c
luaE_extendCI
CallInfo * luaE_extendCI(lua_State *L)
Definition: lstate.c:105
G
#define G(L)
Definition: lstate.h:330
preinit_thread
static void preinit_thread(lua_State *L, global_State *g)
Definition: lstate.c:249
lua_newstate
LUA_API lua_State * lua_newstate(lua_Alloc f, void *ud)
Definition: lstate.c:354
lprefix.h
setthvalue2s
#define setthvalue2s(L, o, t)
Definition: lobject.h:260
global_State::sweepgc
GCObject ** sweepgc
Definition: lstate.h:272
ldebug.h
lua_lock
#define lua_lock(L)
Definition: llimits.h:237
lu_byte
unsigned char lu_byte
Definition: llimits.h:36
lua_State
Definition: lstate.h:304
global_State::gcstopem
lu_byte gcstopem
Definition: lstate.h:263
luaE_warning
void luaE_warning(lua_State *L, const char *msg, int tocont)
Definition: lstate.c:417
lua_State::oldpc
int oldpc
Definition: lstate.h:323
LG::l
LX l
Definition: lstate.c:45
close_state
static void close_state(lua_State *L)
Definition: lstate.c:269
LUAI_GCSTEPSIZE
#define LUAI_GCSTEPSIZE
Definition: lgc.h:141
mqtt_test.time
float time
Definition: mqtt_test.py:17
LUA_API
#define LUA_API
Definition: luaconf.h:282
lua_State::nCcalls
l_uint32 nCcalls
Definition: lstate.h:322
init_registry
static void init_registry(lua_State *L, global_State *g)
Definition: lstate.c:216
luaD_seterrorobj
void luaD_seterrorobj(lua_State *L, int errcode, StkId oldtop)
Definition: ldo.c:91
luaH_new
Table * luaH_new(lua_State *L)
Definition: ltable.c:615
addbuff
#define addbuff(b, p, e)
Definition: lstate.c:67
LUAI_GENMAJORMUL
#define LUAI_GENMAJORMUL
Definition: lgc.h:125
luaE_resetthread
int luaE_resetthread(lua_State *L, int status)
Definition: lstate.c:326
lua_State::base_ci
CallInfo base_ci
Definition: lstate.h:319
LUAI_GCMUL
#define LUAI_GCMUL
Definition: lgc.h:138
luaM_newobject
#define luaM_newobject(L, tag, s)
Definition: lmem.h:64
lua_State::ci
CallInfo * ci
Definition: lstate.h:311
lua_setcstacklimit
LUA_API int lua_setcstacklimit(lua_State *L, unsigned int limit)
Definition: lstate.c:99
lua_State::openupval
UpVal * openupval
Definition: lstate.h:314
gettotalbytes
#define gettotalbytes(g)
Definition: lstate.h:389
lua_close
LUA_API void lua_close(lua_State *L)
Definition: lstate.c:410
global_State::totalbytes
l_mem totalbytes
Definition: lstate.h:252
LUAI_MAXCCALLS
#define LUAI_MAXCCALLS
Definition: llimits.h:228
lua_State::twups
struct lua_State * twups
Definition: lstate.h:317
CIST_C
#define CIST_C
Definition: lstate.h:206
LG::g
global_State g
Definition: lstate.c:46
LUA_YIELD
#define LUA_YIELD
Definition: lua.h:50
luaS_hash
unsigned int luaS_hash(const char *str, size_t l, unsigned int seed)
Definition: lstring.c:43
MAX_LMEM
#define MAX_LMEM
Definition: llimits.h:50
luaC_freeallobjects
void luaC_freeallobjects(lua_State *L)
Definition: lgc.c:1503
lua_State::hookmask
volatile l_signalT hookmask
Definition: lstate.h:326
global_State::gcemergency
lu_byte gcemergency
Definition: lstate.h:267
luaD_throw
l_noret luaD_throw(lua_State *L, int errcode)
Definition: ldo.c:115
luaX_init
void luaX_init(lua_State *L)
Definition: llex.c:70
setivalue
#define setivalue(obj, x)
Definition: lobject.h:331
luaE_shrinkCI
void luaE_shrinkCI(lua_State *L)
Definition: lstate.c:138
LUAI_GCPAUSE
#define LUAI_GCPAUSE
Definition: lgc.h:129
lua_resetthread
LUA_API int lua_resetthread(lua_State *L)
Definition: lstate.c:345
luaM_new
#define luaM_new(L, t)
Definition: lmem.h:59
LUA_EXTRASPACE
#define LUA_EXTRASPACE
Definition: luaconf.h:749
setgcparam
#define setgcparam(p, v)
Definition: lgc.h:136
global_State::warnf
lua_WarnFunction warnf
Definition: lstate.h:296
global_State
Definition: lstate.h:249
luai_userstatethread
#define luai_userstatethread(L, L1)
Definition: llimits.h:263
global_State::GCdebt
l_mem GCdebt
Definition: lstate.h:253
lstring.h
stringtable::nuse
int nuse
Definition: lstate.h:152
global_State::survival
GCObject * survival
Definition: lstate.h:282
global_State::frealloc
lua_Alloc frealloc
Definition: lstate.h:250
CallInfo
Definition: lstate.h:172
lapi.h
stringtable::size
int size
Definition: lstate.h:153
luaM_free
#define luaM_free(L, b)
Definition: lmem.h:56
getCcalls
#define getCcalls(L)
Definition: lstate.h:102
lmem.h
LUAI_GENMINORMUL
#define LUAI_GENMINORMUL
Definition: lgc.h:126
LG
struct LG LG
luaM_freearray
#define luaM_freearray(L, b, n)
Definition: lmem.h:57
lua_State::hook
volatile lua_Hook hook
Definition: lstate.h:320
lgc.h
KGC_INC
#define KGC_INC
Definition: lstate.h:146
lua_WarnFunction
void(* lua_WarnFunction)(void *ud, const char *msg, int tocont)
Definition: lua.h:131
stacksize
#define stacksize(th)
Definition: lstate.h:142
next
#define next(ls)
Definition: llex.c:32
LUA_RIDX_GLOBALS
#define LUA_RIDX_GLOBALS
Definition: lua.h:85
luaD_closeprotected
int luaD_closeprotected(lua_State *L, ptrdiff_t level, int status)
Definition: ldo.c:863
global_State::gcstepsize
lu_byte gcstepsize
Definition: lstate.h:270
svalue
#define svalue(o)
Definition: lobject.h:394
global_State::gcstepmul
lu_byte gcstepmul
Definition: lstate.h:269
LX
Definition: lstate.c:35
luaE_freethread
void luaE_freethread(lua_State *L, lua_State *L1)
Definition: lstate.c:316
global_State::firstold1
GCObject * firstold1
Definition: lstate.h:285
stack_init
static void stack_init(lua_State *L1, lua_State *L)
Definition: lstate.c:180
global_State::finobj
GCObject * finobj
Definition: lstate.h:273
global_State::finobjsur
GCObject * finobjsur
Definition: lstate.h:286
Table
Definition: lobject.h:724
global_State::genminormul
lu_byte genminormul
Definition: lstate.h:264
global_State::mt
struct Table * mt[LUA_NUMTAGS]
Definition: lstate.h:294
global_State::ud
void * ud
Definition: lstate.h:251
global_State::currentwhite
lu_byte currentwhite
Definition: lstate.h:260
global_State::ephemeron
GCObject * ephemeron
Definition: lstate.h:277
luaD_rawrunprotected
int luaD_rawrunprotected(lua_State *L, Pfunc f, void *ud)
Definition: ldo.c:138
lua_State::allowhook
lu_byte allowhook
Definition: lstate.h:307
global_State::gcstate
lu_byte gcstate
Definition: lstate.h:261
luaE_freeCI
void luaE_freeCI(lua_State *L)
Definition: lstate.c:122
global_State::allgc
GCObject * allgc
Definition: lstate.h:271
lua_getextraspace
#define lua_getextraspace(L)
Definition: lua.h:360
lfunc.h
lua_newthread
LUA_API lua_State * lua_newthread(lua_State *L)
Definition: lstate.c:285
ldo.h
CallInfo::l
struct CallInfo::@12::@14 l
TValue
Definition: lobject.h:65
global_State::finobjrold
GCObject * finobjrold
Definition: lstate.h:288
cast_int
#define cast_int(i)
Definition: llimits.h:128
ttisstring
#define ttisstring(o)
Definition: lobject.h:350
luai_userstateclose
#define luai_userstateclose(L)
Definition: llimits.h:259


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:23