aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lgc.c b/lgc.c
index 58d0bf7d..a43cc6a8 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1695,21 +1695,23 @@ static void incstep (lua_State *L, global_State *g) {
1695 1695
1696 1696
1697#if !defined(luai_tracegc) 1697#if !defined(luai_tracegc)
1698#define luai_tracegc(L) ((void)0) 1698#define luai_tracegc(L,f) ((void)0)
1699#endif 1699#endif
1700 1700
1701/* 1701/*
1702** Performs a basic GC step if collector is running. (If collector is 1702** Performs a basic GC step if collector is running. (If collector was
1703** not running, set a reasonable debt to avoid it being called at 1703** stopped by the user, set a reasonable debt to avoid it being called
1704** every single check.) 1704** at every single check.)
1705*/ 1705*/
1706void luaC_step (lua_State *L) { 1706void luaC_step (lua_State *L) {
1707 global_State *g = G(L); 1707 global_State *g = G(L);
1708 lua_assert(!g->gcemergency); 1708 lua_assert(!g->gcemergency);
1709 if (!gcrunning(g)) /* not running? */ 1709 if (!gcrunning(g)) { /* not running? */
1710 luaE_setdebt(g, 20000); 1710 if (g->gcstp & GCSTPUSR) /* stopped by the user? */
1711 luaE_setdebt(g, 20000);
1712 }
1711 else { 1713 else {
1712 luai_tracegc(L); /* for internal debugging */ 1714 luai_tracegc(L, 1); /* for internal debugging */
1713 switch (g->gckind) { 1715 switch (g->gckind) {
1714 case KGC_INC: case KGC_GENMAJOR: 1716 case KGC_INC: case KGC_GENMAJOR:
1715 incstep(L, g); 1717 incstep(L, g);
@@ -1719,6 +1721,7 @@ void luaC_step (lua_State *L) {
1719 setminordebt(g); 1721 setminordebt(g);
1720 break; 1722 break;
1721 } 1723 }
1724 luai_tracegc(L, 0); /* for internal debugging */
1722 } 1725 }
1723} 1726}
1724 1727