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

Function objsize

third-party/lua-5.5.0/src/lgc.c:113–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112
113static l_mem objsize (GCObject *o) {
114 lu_mem res;
115 switch (o->tt) {
116 case LUA_VTABLE: {
117 res = luaH_size(gco2t(o));
118 break;
119 }
120 case LUA_VLCL: {
121 LClosure *cl = gco2lcl(o);
122 res = sizeLclosure(cl->nupvalues);
123 break;
124 }
125 case LUA_VCCL: {
126 CClosure *cl = gco2ccl(o);
127 res = sizeCclosure(cl->nupvalues);
128 break;
129 }
130 case LUA_VUSERDATA: {
131 Udata *u = gco2u(o);
132 res = sizeudata(u->nuvalue, u->len);
133 break;
134 }
135 case LUA_VPROTO: {
136 res = luaF_protosize(gco2p(o));
137 break;
138 }
139 case LUA_VTHREAD: {
140 res = luaE_threadsize(gco2th(o));
141 break;
142 }
143 case LUA_VSHRSTR: {
144 TString *ts = gco2ts(o);
145 res = sizestrshr(cast_uint(ts->shrlen));
146 break;
147 }
148 case LUA_VLNGSTR: {
149 TString *ts = gco2ts(o);
150 res = luaS_sizelngstr(ts->u.lnglen, ts->shrlen);
151 break;
152 }
153 case LUA_VUPVAL: {
154 res = sizeof(UpVal);
155 break;
156 }
157 default: res = 0; lua_assert(0);
158 }
159 return cast(l_mem, res);
160}
161
162
163static GCObject **getgclist (GCObject *o) {

Callers 3

reallymarkobjectFunction · 0.85
freeobjFunction · 0.85
sweepgenFunction · 0.85

Calls 4

luaH_sizeFunction · 0.85
luaF_protosizeFunction · 0.85
luaE_threadsizeFunction · 0.85
luaS_sizelngstrFunction · 0.85

Tested by

no test coverage detected