diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-11-02 14:19:29 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-11-02 14:19:29 -0200 |
commit | cd73f3ccc5e85bc2b3e45477e2f6e3b705bf3c24 (patch) | |
tree | d7a409b0309add167f5c1626cd4be5bdcfc73eca /lgc.c | |
parent | 8c1fb918027eea52c229907e3c3e371c7c14923a (diff) | |
download | lua-cd73f3ccc5e85bc2b3e45477e2f6e3b705bf3c24.tar.gz lua-cd73f3ccc5e85bc2b3e45477e2f6e3b705bf3c24.tar.bz2 lua-cd73f3ccc5e85bc2b3e45477e2f6e3b705bf3c24.zip |
now that we have a counter for CallInfos, use it for a more
accurate value for the memory used by a thread
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 2.206 2015/07/13 13:30:03 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.207 2015/09/08 15:41:05 roberto Exp roberto $ |
3 | ** Garbage Collector | 3 | ** Garbage Collector |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -542,7 +542,8 @@ static lu_mem traversethread (global_State *g, lua_State *th) { | |||
542 | } | 542 | } |
543 | else if (g->gckind != KGC_EMERGENCY) | 543 | else if (g->gckind != KGC_EMERGENCY) |
544 | luaD_shrinkstack(th); /* do not change stack in emergency cycle */ | 544 | luaD_shrinkstack(th); /* do not change stack in emergency cycle */ |
545 | return (sizeof(lua_State) + sizeof(TValue) * th->stacksize); | 545 | return (sizeof(lua_State) + sizeof(TValue) * th->stacksize + |
546 | sizeof(CallInfo) * th->nci); | ||
546 | } | 547 | } |
547 | 548 | ||
548 | 549 | ||