Skip to content

Commit

Permalink
now that we have a counter for CallInfos, use it for a more
Browse files Browse the repository at this point in the history
accurate value for the memory used by a thread
  • Loading branch information
roberto-ieru committed Nov 2, 2015
1 parent 8c1fb91 commit cd73f3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lgc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lgc.c,v 2.206 2015/07/13 13:30:03 roberto Exp roberto $
** $Id: lgc.c,v 2.207 2015/09/08 15:41:05 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -542,7 +542,8 @@ static lu_mem traversethread (global_State *g, lua_State *th) {
}
else if (g->gckind != KGC_EMERGENCY)
luaD_shrinkstack(th); /* do not change stack in emergency cycle */
return (sizeof(lua_State) + sizeof(TValue) * th->stacksize);
return (sizeof(lua_State) + sizeof(TValue) * th->stacksize +
sizeof(CallInfo) * th->nci);
}


Expand Down

0 comments on commit cd73f3c

Please sign in to comment.