瀏覽代碼

Small bug in 'luaE_luaE_statesize'

Plus, function was renamed to 'luaE_threadsize'.
Roberto Ierusalimschy 9 月之前
父節點
當前提交
9b01da97e3
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      lgc.c
  2. 2 2
      lstate.c
  3. 1 1
      lstate.h

+ 1 - 1
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);

+ 2 - 2
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;

+ 1 - 1
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);