summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-25 17:51:29 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-25 17:51:29 +0000
commit7dab9e1557d87ce9f76f7ec5be0c6bb0b395beb4 (patch)
treeb1ae1b19dcbccfc780d71b22f146cc6079ab95cd /gc.c
parent92d589dbedc67be0f8a6d781bebc2c564fe24acc (diff)
downloadruby-7dab9e1557d87ce9f76f7ec5be0c6bb0b395beb4.tar.gz
ruby-7dab9e1557d87ce9f76f7ec5be0c6bb0b395beb4.tar.xz
ruby-7dab9e1557d87ce9f76f7ec5be0c6bb0b395beb4.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gc.c b/gc.c
index b6b0aa8a7..8533773d3 100644
--- a/gc.c
+++ b/gc.c
@@ -41,9 +41,9 @@ static void run_final();
#ifndef GC_MALLOC_LIMIT
#if defined(MSDOS) || defined(__human68k__)
-#define GC_MALLOC_LIMIT 100000
+#define GC_MALLOC_LIMIT 200000
#else
-#define GC_MALLOC_LIMIT 4000000
+#define GC_MALLOC_LIMIT 8000000
#endif
#endif
@@ -70,6 +70,7 @@ ruby_xmalloc(size)
}
if (size == 0) size = 1;
malloc_memories += size;
+
if (malloc_memories > GC_MALLOC_LIMIT) {
rb_gc();
}
@@ -118,7 +119,7 @@ ruby_xrealloc(ptr, size)
rb_gc();
mem = realloc(ptr, size);
if (!mem)
- if (size >= 10 * 1024 * 1024) {
+ if (size >= 50 * 1024 * 1024) {
rb_raise(rb_eNoMemError, "tryed to re-allocate too big memory");
}
mem_error("failed to allocate memory(realloc)");