ruby-changes:5646
From: nobu <ko1@a...>
Date: Sat, 14 Jun 2008 00:09:39 +0900 (JST)
Subject: [ruby-changes:5646] Ruby:r17153 (trunk): * gc.c (ruby_gc_stress): moved to rb_objspace_t.
nobu 2008-06-14 00:09:22 +0900 (Sat, 14 Jun 2008) New Revision: 17153 Modified files: trunk/ChangeLog trunk/gc.c trunk/signal.c trunk/version.h Log: * gc.c (ruby_gc_stress): moved to rb_objspace_t. * gc.c (gc_stress_get, gc_stress_set): VM local attribute. * signal.c (sigsegv): ditto. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=17153&r2=17152&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17153&r2=17152&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/gc.c?r1=17153&r2=17152&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/signal.c?r1=17153&r2=17152&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 17152) +++ ChangeLog (revision 17153) @@ -1,3 +1,11 @@ +Sat Jun 14 00:09:19 2008 Nobuyoshi Nakada <nobu@r...> + + * gc.c (ruby_gc_stress): moved to rb_objspace_t. + + * gc.c (gc_stress_get, gc_stress_set): VM local attribute. + + * signal.c (sigsegv): ditto. + Fri Jun 13 21:55:48 2008 Tadayoshi Funaba <tadf@d...> * rational.c (nurat_equal_p): Rational(0,x) and 0 are equivalent, Index: gc.c =================================================================== --- gc.c (revision 17152) +++ gc.c (revision 17153) @@ -179,6 +179,7 @@ } markstack; struct gc_list *global_list; unsigned int count; + int gc_stress; } rb_objspace_t; #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE @@ -206,6 +207,7 @@ #define mark_stack_ptr objspace->markstack.ptr #define mark_stack_overflow objspace->markstack.overflow #define global_List objspace->global_list +#define ruby_gc_stress objspace->gc_stress #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE rb_objspace_t * @@ -243,7 +245,7 @@ VALUE *rb_gc_register_stack_start = 0; #endif -int ruby_gc_stress = 0; +int ruby_disable_gc_stress = 0; #ifdef DJGPP @@ -289,6 +291,7 @@ static VALUE gc_stress_get(VALUE self) { + rb_objspace_t *objspace = &rb_objspace; return ruby_gc_stress ? Qtrue : Qfalse; } @@ -307,6 +310,7 @@ static VALUE gc_stress_set(VALUE self, VALUE bool) { + rb_objspace_t *objspace = &rb_objspace; rb_secure(2); ruby_gc_stress = RTEST(bool); return bool; @@ -326,7 +330,8 @@ size += sizeof(size_t); #endif - if (ruby_gc_stress || (malloc_increase+size) > malloc_limit) { + if ((ruby_gc_stress && !ruby_disable_gc_stress) || + (malloc_increase+size) > malloc_limit) { garbage_collect(objspace); } RUBY_CRITICAL(mem = malloc(size)); @@ -360,7 +365,7 @@ } if (!ptr) return ruby_xmalloc(size); if (size == 0) size = 1; - if (ruby_gc_stress) garbage_collect(objspace); + if (ruby_gc_stress && !ruby_disable_gc_stress) garbage_collect(objspace); #if CALC_EXACT_MALLOC_SIZE size += sizeof(size_t); @@ -664,7 +669,7 @@ { VALUE obj; - if (ruby_gc_stress || !freelist) { + if ((ruby_gc_stress && !ruby_disable_gc_stress) || !freelist) { if (!heaps_increment(objspace) && !garbage_collect(objspace)) { rb_memerror(); } Index: version.h =================================================================== --- version.h (revision 17152) +++ version.h (revision 17153) @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2008-06-13" +#define RUBY_RELEASE_DATE "2008-06-14" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20080613 +#define RUBY_RELEASE_CODE 20080614 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 13 +#define RUBY_RELEASE_DAY 14 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; Index: signal.c =================================================================== --- signal.c (revision 17152) +++ signal.c (revision 17153) @@ -554,12 +554,12 @@ { if (segv_received) { fprintf(stderr, "SEGV recieved in SEGV handler\n"); - exit(1); + exit(EXIT_FAILURE); } else { - extern int ruby_gc_stress; + extern int ruby_disable_gc_stress; segv_received = 1; - ruby_gc_stress = 0; + ruby_disable_gc_stress = 1; rb_bug("Segmentation fault"); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/