From 224e59c6f82c98da0d507cfae3b39c97b6769d51 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 28 Jun 2000 08:31:35 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 8257143f9c..c615db031e 100644 --- a/gc.c +++ b/gc.c @@ -46,13 +46,10 @@ static void run_final(); #define GC_MALLOC_LIMIT 400000 #endif #endif -#define GC_NEWOBJ_LIMIT 10000 static unsigned long malloc_memories = 0; static unsigned long alloc_objects = 0; -static int malloc_called = 0; - static void mem_error(mesg) char *mesg; @@ -74,17 +71,16 @@ ruby_xmalloc(size) } if (size == 0) size = 1; malloc_memories += size; - if (malloc_memories > GC_MALLOC_LIMIT && alloc_objects > GC_NEWOBJ_LIMIT) { + if (malloc_memories > GC_MALLOC_LIMIT) { rb_gc(); } - malloc_called++; mem = malloc(size); if (!mem) { rb_gc(); mem = malloc(size); if (!mem) { if (size >= 10 * 1024 * 1024) { - rb_raise(rb_eNoMemError, "try to allocate too big memory"); + rb_raise(rb_eNoMemError, "tryed to allocate too big memory"); } mem_error("failed to allocate memory"); } @@ -124,7 +120,7 @@ ruby_xrealloc(ptr, size) mem = realloc(ptr, size); if (!mem) if (size >= 10 * 1024 * 1024) { - rb_raise(rb_eNoMemError, "try to re-allocate too big memory"); + rb_raise(rb_eNoMemError, "tryed to re-allocate too big memory"); } mem_error("failed to allocate memory(realloc)"); } @@ -244,7 +240,7 @@ static int heaps_length = 0; static int heaps_used = 0; #define HEAP_SLOTS 10000 -#define FREE_MIN 512 +#define FREE_MIN 4096 static RVALUE *himem, *lomem; -- cgit v1.2.3