| 147 | |
| 148 | |
| 149 | size_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 | /* |
no outgoing calls
no test coverage detected