From 1b4d97ddba6b3190a4aecad2c6159e6ecd63604e Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 1 Oct 2004 15:56:05 +0000 Subject: * string.c (rb_str_sum): string may be altered. [ruby-dev:24381] * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe sourcefile string modification. [ruby-dev:24373] * io.c (io_read): block string buffer modification during rb_io_fread() by freezing it temporarily. [ruby-dev:24366] * io.c (rb_io_s_popen): mode argument may be altered. [ruby-dev:24375] * file.c (rb_file_s_basename): ext argument may be altered. [ruby-dev:24377] * enum.c (enum_sort_by): use NODE instead of 2 element arrays. [ruby-dev:24378] * string.c (rb_str_chomp_bang): StringValue() may change the receiver. [ruby-dev:24371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index fba3ee8fba..d3a7b477fc 100644 --- a/gc.c +++ b/gc.c @@ -92,7 +92,7 @@ static unsigned long malloc_increase = 0; static unsigned long malloc_limit = GC_MALLOC_LIMIT; static void run_final(); static VALUE nomem_error; -static void gc_internal(); +static void garbage_collect(); void rb_memerror() @@ -120,11 +120,11 @@ ruby_xmalloc(size) malloc_increase += size; if (malloc_increase > malloc_limit) { - gc_internal(); + garbage_collect(); } RUBY_CRITICAL(mem = malloc(size)); if (!mem) { - gc_internal(); + garbage_collect(); RUBY_CRITICAL(mem = malloc(size)); if (!mem) { rb_memerror(); @@ -161,7 +161,7 @@ ruby_xrealloc(ptr, size) malloc_increase += size; RUBY_CRITICAL(mem = realloc(ptr, size)); if (!mem) { - gc_internal(); + garbage_collect(); RUBY_CRITICAL(mem = realloc(ptr, size)); if (!mem) { rb_memerror(); @@ -381,7 +381,7 @@ rb_newobj() { VALUE obj; - if (!freelist) gc_internal(); + if (!freelist) garbage_collect(); obj = (VALUE)freelist; freelist = freelist->as.free.next; @@ -1288,7 +1288,7 @@ int rb_setjmp (rb_jmp_buf); #endif /* __GNUC__ */ static void -gc_internal() +garbage_collect() { struct gc_list *list; struct FRAME * volatile frame; /* gcc 2.7.2.3 -O2 bug?? */ @@ -1403,7 +1403,7 @@ gc_internal() void rb_gc() { - gc_internal(); + garbage_collect(); rb_gc_finalize_deferred(); } -- cgit v1.2.3