summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-15 06:13:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-15 06:13:08 +0000
commitc30c3bffe472ee999fc722f63dd1c1984db1d1ce (patch)
treefd5a1cd95ad875ce2768b09c88cecc155dba74b8 /gc.c
parent35c6e6af5ba2c405a91dc6b9e4af833d0979ed22 (diff)
1.1b9_31
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index d21d58b3fd..e6b001fca1 100644
--- a/gc.c
+++ b/gc.c
@@ -37,9 +37,9 @@ static void run_final();
#ifndef GC_MALLOC_LIMIT
#if defined(MSDOS) || defined(__human68k__)
-#define GC_MALLOC_LIMIT 200000
+#define GC_MALLOC_LIMIT 100000
#else
-#define GC_MALLOC_LIMIT 400000
+#define GC_MALLOC_LIMIT 200000
#endif
#endif
@@ -55,12 +55,10 @@ xmalloc(size)
ArgError("negative allocation size (or too big)");
}
if (size == 0) size = 1;
-#if 0
malloc_memories += size;
if (malloc_memories > GC_MALLOC_LIMIT) {
gc_gc();
}
-#endif
mem = malloc(size);
if (!mem) {
gc_gc();
@@ -95,6 +93,10 @@ xrealloc(ptr, size)
ArgError("negative re-allocation size");
}
if (!ptr) return xmalloc(size);
+ malloc_memories += size;
+ if (malloc_memories > GC_MALLOC_LIMIT) {
+ gc_gc();
+ }
mem = realloc(ptr, size);
if (!mem) {
gc_gc();