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

Function luaS_sizelngstr

third-party/lua-5.5.0/src/lstring.c:149–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147
148
149size_t luaS_sizelngstr (size_t len, int kind) {
150 switch (kind) {
151 case LSTRREG: /* regular long string */
152 /* don't need 'falloc'/'ud', but need space for content */
153 return offsetof(TString, falloc) + (len + 1) * sizeof(char);
154 case LSTRFIX: /* fixed external long string */
155 /* don't need 'falloc'/'ud' */
156 return offsetof(TString, falloc);
157 default: /* external long string with deallocation */
158 lua_assert(kind == LSTRMEM);
159 return sizeof(TString);
160 }
161}
162
163
164/*

Callers 4

luaS_createlngstrobjFunction · 0.85
f_newextFunction · 0.85
objsizeFunction · 0.85
freeobjFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected