aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lgc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lgc.c b/lgc.c
index 2e749902..20e9b4aa 100644
--- a/lgc.c
+++ b/lgc.c
@@ -259,6 +259,7 @@ GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, size_t offset) {
259 global_State *g = G(L); 259 global_State *g = G(L);
260 char *p = cast_charp(luaM_newobject(L, novariant(tt), sz)); 260 char *p = cast_charp(luaM_newobject(L, novariant(tt), sz));
261 GCObject *o = cast(GCObject *, p + offset); 261 GCObject *o = cast(GCObject *, p + offset);
262 g->totalobjs++;
262 o->marked = luaC_white(g); 263 o->marked = luaC_white(g);
263 o->tt = tt; 264 o->tt = tt;
264 o->next = g->allgc; 265 o->next = g->allgc;
@@ -768,6 +769,7 @@ static void freeupval (lua_State *L, UpVal *uv) {
768 769
769 770
770static void freeobj (lua_State *L, GCObject *o) { 771static void freeobj (lua_State *L, GCObject *o) {
772 G(L)->totalobjs--;
771 switch (o->tt) { 773 switch (o->tt) {
772 case LUA_VPROTO: 774 case LUA_VPROTO:
773 luaF_freeproto(L, gco2p(o)); 775 luaF_freeproto(L, gco2p(o));