Lines Matching refs:g
37 global_State g; member
71 global_State *g = G(L); in f_luaopen() local
80 g->GCthreshold = 4*g->totalbytes; in f_luaopen()
84 static void preinit_state (lua_State *L, global_State *g) { in preinit_state() argument
85 G(L) = g; in preinit_state()
106 global_State *g = G(L); in close_state() local
109 lua_assert(g->rootgc == obj2gco(L)); in close_state()
110 lua_assert(g->strt.nuse == 0); in close_state()
112 luaZ_freebuffer(L, &g->buff); in close_state()
114 lua_assert(g->totalbytes == sizeof(LG)); in close_state()
115 (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); in close_state()
146 global_State *g; in lua_newstate() local
150 g = &((LG *)L)->g; in lua_newstate()
153 g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); in lua_newstate()
154 L->marked = luaC_white(g); in lua_newstate()
156 preinit_state(L, g); in lua_newstate()
157 g->frealloc = f; in lua_newstate()
158 g->ud = ud; in lua_newstate()
159 g->mainthread = L; in lua_newstate()
160 g->uvhead.u.l.prev = &g->uvhead; in lua_newstate()
161 g->uvhead.u.l.next = &g->uvhead; in lua_newstate()
162 g->GCthreshold = 0; /* mark it as unfinished state */ in lua_newstate()
163 g->strt.size = 0; in lua_newstate()
164 g->strt.nuse = 0; in lua_newstate()
165 g->strt.hash = NULL; in lua_newstate()
167 luaZ_initbuffer(L, &g->buff); in lua_newstate()
168 g->panic = NULL; in lua_newstate()
169 g->gcstate = GCSpause; in lua_newstate()
170 g->rootgc = obj2gco(L); in lua_newstate()
171 g->sweepstrgc = 0; in lua_newstate()
172 g->sweepgc = &g->rootgc; in lua_newstate()
173 g->gray = NULL; in lua_newstate()
174 g->grayagain = NULL; in lua_newstate()
175 g->weak = NULL; in lua_newstate()
176 g->tmudata = NULL; in lua_newstate()
177 g->totalbytes = sizeof(LG); in lua_newstate()
178 g->gcpause = LUAI_GCPAUSE; in lua_newstate()
179 g->gcstepmul = LUAI_GCMUL; in lua_newstate()
180 g->gcdept = 0; in lua_newstate()
181 for (i=0; i<NUM_TAGS; i++) g->mt[i] = NULL; in lua_newstate()