aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-04-02 11:37:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-04-02 11:37:41 -0300
commite54668b6961a610a1b83a78a11581e2e6cfc0c7e (patch)
tree3e5d44b4a151d95a662626d47c1e00ce23d0a25c /lgc.c
parent9eb832de5478fc8ac45bdc542178f49b390980b8 (diff)
downloadlua-e54668b6961a610a1b83a78a11581e2e6cfc0c7e.tar.gz
lua-e54668b6961a610a1b83a78a11581e2e6cfc0c7e.tar.bz2
lua-e54668b6961a610a1b83a78a11581e2e6cfc0c7e.zip
added proper code to trace garbage collection
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/lgc.c b/lgc.c
index 64c662b1..acbbf9c5 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.74 2010/03/26 20:58:11 roberto Exp roberto $ 2** $Id: lgc.c,v 2.75 2010/03/29 17:43:14 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*/
@@ -825,10 +825,7 @@ void luaC_runtilstate (lua_State *L, int statesmask) {
825 825
826 826
827static void generationalcollection (lua_State *L) { 827static void generationalcollection (lua_State *L) {
828static int c = 0;
829static int prev = 0;
830 global_State *g = G(L); 828 global_State *g = G(L);
831int a = g->totalbytes;
832 lua_assert(g->gcstate == GCSpropagate); 829 lua_assert(g->gcstate == GCSpropagate);
833 if (g->lastmajormem == 0) { /* signal for another major collection? */ 830 if (g->lastmajormem == 0) { /* signal for another major collection? */
834 luaC_fullgc(L, 0); /* perform a full regular collection */ 831 luaC_fullgc(L, 0); /* perform a full regular collection */
@@ -841,9 +838,6 @@ int a = g->totalbytes;
841 g->lastmajormem = 0; /* signal for a major collection */ 838 g->lastmajormem = 0; /* signal for a major collection */
842 } 839 }
843 g->GCthreshold = (g->totalbytes/100) * g->gcpause; 840 g->GCthreshold = (g->totalbytes/100) * g->gcpause;
844/*printf("count: %d old: %d new: %d dif: %d lim: %d threshold: %d\n",
845c++, a, g->totalbytes, g->totalbytes - prev, g->lastmajormem, g->GCthreshold);*/
846prev = g->totalbytes;
847} 841}
848 842
849 843