Lines Matching +full:1 +full:g

46   global_State g;  member
89 void luaE_setdebt (global_State *g, l_mem debt) { in luaE_setdebt() argument
90 l_mem tb = gettotalbytes(g); in luaE_setdebt()
94 g->totalbytes = tb - debt; in luaE_setdebt()
95 g->GCdebt = debt; in luaE_setdebt()
216 static void init_registry (lua_State *L, global_State *g) { in init_registry() argument
219 sethvalue(L, &g->l_registry, registry); in init_registry()
222 setthvalue(L, &registry->array[LUA_RIDX_MAINTHREAD - 1], L); in init_registry()
224 sethvalue(L, &registry->array[LUA_RIDX_GLOBALS - 1], luaH_new(L)); in init_registry()
232 global_State *g = G(L); in f_luaopen() local
235 init_registry(L, g); in f_luaopen()
239 g->gcstp = 0; /* allow gc */ in f_luaopen()
240 setnilvalue(&g->nilvalue); /* now state is complete */ in f_luaopen()
249 static void preinit_thread (lua_State *L, global_State *g) { in preinit_thread() argument
250 G(L) = g; in preinit_thread()
260 L->allowhook = 1; in preinit_thread()
270 global_State *g = G(L); in close_state() local
271 if (!completestate(g)) /* closing a partially built state? */ in close_state()
276 luaD_closeprotected(L, 1, LUA_OK); /* close all upvalues */ in close_state()
277 L->top.p = L->stack.p + 1; /* empty the stack to run finalizers */ in close_state()
281 luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); in close_state()
283 lua_assert(gettotalbytes(g) == sizeof(LG)); in close_state()
284 (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ in close_state()
289 global_State *g = G(L); in lua_newthread() local
300 preinit_thread(L1, g); in lua_newthread()
306 memcpy(lua_getextraspace(L1), lua_getextraspace(g->mainthread), in lua_newthread()
334 status = luaD_closeprotected(L, 1, status); in luaE_resetthread()
336 luaD_seterrorobj(L, status, L->stack.p + 1); in luaE_resetthread()
338 L->top.p = L->stack.p + 1; in luaE_resetthread()
366 global_State *g; in lua_newstate() local
370 g = &l->g; in lua_newstate()
372 g->currentwhite = bitmask(WHITE0BIT); in lua_newstate()
373 L->marked = luaC_white(g); in lua_newstate()
374 preinit_thread(L, g); in lua_newstate()
375 g->allgc = obj2gco(L); /* by now, only object is the main thread */ in lua_newstate()
378 g->frealloc = f; in lua_newstate()
379 g->ud = ud; in lua_newstate()
380 g->warnf = NULL; in lua_newstate()
381 g->ud_warn = NULL; in lua_newstate()
382 g->mainthread = L; in lua_newstate()
383 g->seed = luai_makeseed(L); in lua_newstate()
384 g->gcstp = GCSTPGC; /* no GC while building state */ in lua_newstate()
385 g->strt.size = g->strt.nuse = 0; in lua_newstate()
386 g->strt.hash = NULL; in lua_newstate()
387 setnilvalue(&g->l_registry); in lua_newstate()
388 g->panic = NULL; in lua_newstate()
389 g->gcstate = GCSpause; in lua_newstate()
390 g->gckind = KGC_INC; in lua_newstate()
391 g->gcstopem = 0; in lua_newstate()
392 g->gcemergency = 0; in lua_newstate()
393 g->finobj = g->tobefnz = g->fixedgc = NULL; in lua_newstate()
394 g->firstold1 = g->survival = g->old1 = g->reallyold = NULL; in lua_newstate()
395 g->finobjsur = g->finobjold1 = g->finobjrold = NULL; in lua_newstate()
396 g->sweepgc = NULL; in lua_newstate()
397 g->gray = g->grayagain = NULL; in lua_newstate()
398 g->weak = g->ephemeron = g->allweak = NULL; in lua_newstate()
399 g->twups = NULL; in lua_newstate()
400 g->totalbytes = sizeof(LG); in lua_newstate()
401 g->GCdebt = 0; in lua_newstate()
402 g->lastatomic = 0; in lua_newstate()
403 setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */ in lua_newstate()
404 setgcparam(g->gcpause, LUAI_GCPAUSE); in lua_newstate()
405 setgcparam(g->gcstepmul, LUAI_GCMUL); in lua_newstate()
406 g->gcstepsize = LUAI_GCSTEPSIZE; in lua_newstate()
407 setgcparam(g->genmajormul, LUAI_GENMAJORMUL); in lua_newstate()
408 g->genminormul = LUAI_GENMINORMUL; in lua_newstate()
409 for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; in lua_newstate()
421 L = G(L)->mainthread; /* only the main thread can be closed */ in lua_close()
427 lua_WarnFunction wf = G(L)->warnf; in luaE_warning()
429 wf(G(L)->ud_warn, msg, tocont); in luaE_warning()
437 TValue *errobj = s2v(L->top.p - 1); /* error object */ in luaE_warnerror()
442 luaE_warning(L, "error in ", 1); in luaE_warnerror()
443 luaE_warning(L, where, 1); in luaE_warnerror()
444 luaE_warning(L, " (", 1); in luaE_warnerror()
445 luaE_warning(L, msg, 1); in luaE_warnerror()