Lines Matching refs: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->gcrunning = 1; /* 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()
280 lua_assert(gettotalbytes(g) == sizeof(LG)); in close_state()
281 (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ in close_state()
286 global_State *g; in lua_newthread() local
289 g = G(L); in lua_newthread()
293 L1->marked = luaC_white(g); in lua_newthread()
296 L1->next = g->allgc; in lua_newthread()
297 g->allgc = obj2gco(L1); in lua_newthread()
301 preinit_thread(L1, g); in lua_newthread()
307 memcpy(lua_getextraspace(L1), lua_getextraspace(g->mainthread), in lua_newthread()
357 global_State *g; in lua_newstate() local
361 g = &l->g; in lua_newstate()
363 g->currentwhite = bitmask(WHITE0BIT); in lua_newstate()
364 L->marked = luaC_white(g); in lua_newstate()
365 preinit_thread(L, g); in lua_newstate()
366 g->allgc = obj2gco(L); /* by now, only object is the main thread */ in lua_newstate()
369 g->frealloc = f; in lua_newstate()
370 g->ud = ud; in lua_newstate()
371 g->warnf = NULL; in lua_newstate()
372 g->ud_warn = NULL; in lua_newstate()
373 g->mainthread = L; in lua_newstate()
374 g->seed = luai_makeseed(L); in lua_newstate()
375 g->gcrunning = 0; /* no GC while building state */ in lua_newstate()
376 g->strt.size = g->strt.nuse = 0; in lua_newstate()
377 g->strt.hash = NULL; in lua_newstate()
378 setnilvalue(&g->l_registry); in lua_newstate()
379 g->panic = NULL; in lua_newstate()
380 g->gcstate = GCSpause; in lua_newstate()
381 g->gckind = KGC_INC; in lua_newstate()
382 g->gcstopem = 0; in lua_newstate()
383 g->gcemergency = 0; in lua_newstate()
384 g->finobj = g->tobefnz = g->fixedgc = NULL; in lua_newstate()
385 g->firstold1 = g->survival = g->old1 = g->reallyold = NULL; in lua_newstate()
386 g->finobjsur = g->finobjold1 = g->finobjrold = NULL; in lua_newstate()
387 g->sweepgc = NULL; in lua_newstate()
388 g->gray = g->grayagain = NULL; in lua_newstate()
389 g->weak = g->ephemeron = g->allweak = NULL; in lua_newstate()
390 g->twups = NULL; in lua_newstate()
391 g->totalbytes = sizeof(LG); in lua_newstate()
392 g->GCdebt = 0; in lua_newstate()
393 g->lastatomic = 0; in lua_newstate()
394 setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */ in lua_newstate()
395 setgcparam(g->gcpause, LUAI_GCPAUSE); in lua_newstate()
396 setgcparam(g->gcstepmul, LUAI_GCMUL); in lua_newstate()
397 g->gcstepsize = LUAI_GCSTEPSIZE; in lua_newstate()
398 setgcparam(g->genmajormul, LUAI_GENMAJORMUL); in lua_newstate()
399 g->genminormul = LUAI_GENMINORMUL; in lua_newstate()
400 for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; in lua_newstate()