Skip to content

Commit 9b01da9

Browse files
committed
Small bug in 'luaE_luaE_statesize'
Plus, function was renamed to 'luaE_threadsize'.
1 parent 2583557 commit 9b01da9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lgc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static size_t objsize (GCObject *o) {
132132
return luaF_protosize(gco2p(o));
133133
}
134134
case LUA_VTHREAD: {
135-
return luaE_statesize(gco2th(o));
135+
return luaE_threadsize(gco2th(o));
136136
}
137137
case LUA_VSHRSTR: {
138138
TString *ts = gco2ts(o);

lstate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ static void preinit_thread (lua_State *L, global_State *g) {
257257
}
258258

259259

260-
size_t luaE_statesize (lua_State *L) {
261-
size_t sz = sizeof(LG) + cast_uint(L->nci) * sizeof(CallInfo);
260+
size_t luaE_threadsize (lua_State *L) {
261+
size_t sz = sizeof(LX) + cast_uint(L->nci) * sizeof(CallInfo);
262262
if (L->stack.p != NULL)
263263
sz += cast_uint(stacksize(L) + EXTRA_STACK) * sizeof(StackValue);
264264
return sz;

lstate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ union GCUnion {
416416

417417
LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt);
418418
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
419-
LUAI_FUNC size_t luaE_statesize (lua_State *L);
419+
LUAI_FUNC size_t luaE_threadsize (lua_State *L);
420420
LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L);
421421
LUAI_FUNC void luaE_shrinkCI (lua_State *L);
422422
LUAI_FUNC void luaE_checkcstack (lua_State *L);

0 commit comments

Comments
 (0)