MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaC_newobj

Function luaC_newobj

freebsd/contrib/openzfs/module/lua/lgc.c:211–223  ·  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

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

Callers 9

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

Calls

no outgoing calls

Tested by

no test coverage detected