MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaC_newobj

Function luaC_newobj

third-party/lua-5.2.4/src/lgc.c:212–224  ·  view source on GitHub ↗

** create a new collectable object (with given type and size) and link ** it to '*list'. 'offset' tells how many bytes to allocate before the ** object itself (used only by states). */

Source from the content-addressed store, hash-verified

210** object itself (used only by states).
211*/
212GCObject *luaC_newobj (lua_State *L, int tt, size_t sz, GCObject **list,
213 int offset) {
214 global_State *g = G(L);
215 char *raw = cast(char *, luaM_newobject(L, novariant(tt), sz));
216 GCObject *o = obj2gco(raw + offset);
217 if (list == NULL)
218 list = &g->allgc; /* standard list for collectable objects */
219 gch(o)->marked = luaC_white(g);
220 gch(o)->tt = tt;
221 gch(o)->next = *list;
222 *list = o;
223 return o;
224}
225
226/* }====================================================== */
227

Callers 9

lua_newthreadFunction · 0.70
luaH_newFunction · 0.70
luaF_newCclosureFunction · 0.70
luaF_newLclosureFunction · 0.70
luaF_newupvalFunction · 0.70
luaF_findupvalFunction · 0.70
luaF_newprotoFunction · 0.70
createstrobjFunction · 0.70
luaS_newudataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected