Lines Matching 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()
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()
270 global_State *g = G(L); in close_state() local
271 if (!completestate(g)) /* closing a partially built state? */ in close_state()
279 luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); in close_state()
281 lua_assert(gettotalbytes(g) == sizeof(LG)); in close_state()
282 (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ in close_state()
287 global_State *g = G(L); in lua_newthread() local
298 preinit_thread(L1, g); in lua_newthread()
304 memcpy(lua_getextraspace(L1), lua_getextraspace(g->mainthread), in lua_newthread()
363 global_State *g; in lua_newstate() local
367 g = &l->g; in lua_newstate()
369 g->currentwhite = bitmask(WHITE0BIT); in lua_newstate()
370 L->marked = luaC_white(g); in lua_newstate()
371 preinit_thread(L, g); in lua_newstate()
372 g->allgc = obj2gco(L); /* by now, only object is the main thread */ in lua_newstate()
375 g->frealloc = f; in lua_newstate()
376 g->ud = ud; in lua_newstate()
377 g->warnf = NULL; in lua_newstate()
378 g->ud_warn = NULL; in lua_newstate()
379 g->mainthread = L; in lua_newstate()
380 g->seed = luai_makeseed(L); in lua_newstate()
381 g->gcstp = GCSTPGC; /* no GC while building state */ in lua_newstate()
382 g->strt.size = g->strt.nuse = 0; in lua_newstate()
383 g->strt.hash = NULL; in lua_newstate()
384 setnilvalue(&g->l_registry); in lua_newstate()
385 g->panic = NULL; in lua_newstate()
386 g->gcstate = GCSpause; in lua_newstate()
387 g->gckind = KGC_INC; in lua_newstate()
388 g->gcstopem = 0; in lua_newstate()
389 g->gcemergency = 0; in lua_newstate()
390 g->finobj = g->tobefnz = g->fixedgc = NULL; in lua_newstate()
391 g->firstold1 = g->survival = g->old1 = g->reallyold = NULL; in lua_newstate()
392 g->finobjsur = g->finobjold1 = g->finobjrold = NULL; in lua_newstate()
393 g->sweepgc = NULL; in lua_newstate()
394 g->gray = g->grayagain = NULL; in lua_newstate()
395 g->weak = g->ephemeron = g->allweak = NULL; in lua_newstate()
396 g->twups = NULL; in lua_newstate()
397 g->totalbytes = sizeof(LG); in lua_newstate()
398 g->GCdebt = 0; in lua_newstate()
399 g->lastatomic = 0; in lua_newstate()
400 setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */ in lua_newstate()
401 setgcparam(g->gcpause, LUAI_GCPAUSE); in lua_newstate()
402 setgcparam(g->gcstepmul, LUAI_GCMUL); in lua_newstate()
403 g->gcstepsize = LUAI_GCSTEPSIZE; in lua_newstate()
404 setgcparam(g->genmajormul, LUAI_GENMAJORMUL); in lua_newstate()
405 g->genminormul = LUAI_GENMINORMUL; in lua_newstate()
406 for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; in lua_newstate()
418 L = G(L)->mainthread; /* only the main thread can be closed */ in lua_close()
424 lua_WarnFunction wf = G(L)->warnf; in luaE_warning()
426 wf(G(L)->ud_warn, msg, tocont); in luaE_warning()