MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / freeobj

Function freeobj

Source/Misc/lua/src/lua.c:6380–6402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6378
6379
6380static void freeobj (lua_State *L, GCObject *o) {
6381switch (o->gch.tt) {
6382case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break;
6383case LUA_TFUNCTION: luaF_freeclosure(L, gco2cl(o)); break;
6384case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break;
6385case LUA_TTABLE: luaH_free(L, gco2h(o)); break;
6386case LUA_TTHREAD: {
6387lua_assert(gco2th(o) != L && gco2th(o) != G(L)->mainthread);
6388luaE_freethread(L, gco2th(o));
6389break;
6390}
6391case LUA_TSTRING: {
6392G(L)->strt.nuse--;
6393luaM_freemem(L, o, sizestring(gco2ts(o)));
6394break;
6395}
6396case LUA_TUSERDATA: {
6397luaM_freemem(L, o, sizeudata(gco2u(o)));
6398break;
6399}
6400default: lua_assert(0);
6401}
6402}
6403
6404
6405

Callers 1

sweeplistFunction · 0.85

Calls 5

luaF_freeprotoFunction · 0.85
luaF_freeclosureFunction · 0.85
luaF_freeupvalFunction · 0.85
luaH_freeFunction · 0.85
luaE_freethreadFunction · 0.85

Tested by

no test coverage detected