Small bug in 'luaE_luaE_statesize'

Plus, function was renamed to 'luaE_threadsize'.
This commit is contained in:
Roberto Ierusalimschy 2024-10-21 15:30:35 -03:00
parent 258355734d
commit 9b01da97e3
3 changed files with 4 additions and 4 deletions

2
lgc.c
View File

@ -132,7 +132,7 @@ static size_t objsize (GCObject *o) {
return luaF_protosize(gco2p(o));
}
case LUA_VTHREAD: {
return luaE_statesize(gco2th(o));
return luaE_threadsize(gco2th(o));
}
case LUA_VSHRSTR: {
TString *ts = gco2ts(o);

View File

@ -257,8 +257,8 @@ static void preinit_thread (lua_State *L, global_State *g) {
}
size_t luaE_statesize (lua_State *L) {
size_t sz = sizeof(LG) + cast_uint(L->nci) * sizeof(CallInfo);
size_t luaE_threadsize (lua_State *L) {
size_t sz = sizeof(LX) + cast_uint(L->nci) * sizeof(CallInfo);
if (L->stack.p != NULL)
sz += cast_uint(stacksize(L) + EXTRA_STACK) * sizeof(StackValue);
return sz;

View File

@ -416,7 +416,7 @@ union GCUnion {
LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt);
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
LUAI_FUNC size_t luaE_statesize (lua_State *L);
LUAI_FUNC size_t luaE_threadsize (lua_State *L);
LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L);
LUAI_FUNC void luaE_shrinkCI (lua_State *L);
LUAI_FUNC void luaE_checkcstack (lua_State *L);