** 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). */
| 210 | ** object itself (used only by states). |
| 211 | */ |
| 212 | GCObject *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 |
no outgoing calls
no test coverage detected