aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lstate.c b/lstate.c
index 1fbefb4b..3091a00e 100644
--- a/lstate.c
+++ b/lstate.c
@@ -279,6 +279,7 @@ static void close_state (lua_State *L) {
279 luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); 279 luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size);
280 freestack(L); 280 freestack(L);
281 lua_assert(gettotalbytes(g) == sizeof(LG)); 281 lua_assert(gettotalbytes(g) == sizeof(LG));
282 lua_assert(g->totalobjs == 1);
282 (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ 283 (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */
283} 284}
284 285
@@ -387,6 +388,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
387 g->weak = g->ephemeron = g->allweak = NULL; 388 g->weak = g->ephemeron = g->allweak = NULL;
388 g->twups = NULL; 389 g->twups = NULL;
389 g->totalbytes = sizeof(LG); 390 g->totalbytes = sizeof(LG);
391 g->totalobjs = 1;
390 g->GCdebt = 0; 392 g->GCdebt = 0;
391 g->lastatomic = 0; 393 g->lastatomic = 0;
392 setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */ 394 setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */