aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lmem.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/lmem.c b/lmem.c
index a36076fb..1a3e25c4 100644
--- a/lmem.c
+++ b/lmem.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmem.c,v 1.68 2005/01/14 14:21:16 roberto Exp roberto $ 2** $Id: lmem.c,v 1.69 2005/02/23 17:30:22 roberto Exp roberto $
3** Interface to Memory Manager 3** Interface to Memory Manager
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -81,22 +81,6 @@ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {
81 luaD_throw(L, LUA_ERRMEM); 81 luaD_throw(L, LUA_ERRMEM);
82 lua_assert((nsize == 0) == (block == NULL)); 82 lua_assert((nsize == 0) == (block == NULL));
83 g->totalbytes = (g->totalbytes - osize) + nsize; 83 g->totalbytes = (g->totalbytes - osize) + nsize;
84#if 0
85 { /* auxiliar patch to monitor garbage collection */
86 static unsigned long total = 0; /* our "time" */
87 static lu_mem last = 0; /* last totalmem that generated an output */
88 static FILE *f = NULL; /* output file */
89 if (nsize <= osize) total += 1; /* "time" always grow */
90 else total += (nsize - osize);
91 if ((int)g->totalbytes - (int)last > 1000 ||
92 (int)g->totalbytes - (int)last < -1000) {
93 last = g->totalbytes;
94 if (f == NULL) f = fopen("trace", "w");
95 fprintf(f, "%lu %u %u %u %d\n", total, g->totalbytes, g->GCthreshold,
96 g->estimate, g->gcstate);
97 }
98 }
99#endif
100 return block; 84 return block;
101} 85}
102 86