From 9b01da97e3a8f2df9acbd3b86af50e4040e9d914 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 21 Oct 2024 15:30:35 -0300 Subject: [PATCH] Small bug in 'luaE_luaE_statesize' Plus, function was renamed to 'luaE_threadsize'. --- lgc.c | 2 +- lstate.c | 4 ++-- lstate.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lgc.c b/lgc.c index a43cc6a8..7922bc08 100644 --- a/lgc.c +++ b/lgc.c @@ -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); diff --git a/lstate.c b/lstate.c index d6b9c90f..a8db9477 100644 --- a/lstate.c +++ b/lstate.c @@ -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; diff --git a/lstate.h b/lstate.h index e2108668..a1b463c6 100644 --- a/lstate.h +++ b/lstate.h @@ -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);