diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-13 15:09:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-13 15:09:22 +0000 |
commit | 4641b801664008c7ae509a79354da1bc84b6fc1c (patch) | |
tree | a27aa76689a6957d6342b2c9c409b78c01cafda1 | |
parent | e0d427e855e514c758ffc8f776539abe70ad12d4 (diff) | |
download | ruby-4641b801664008c7ae509a79354da1bc84b6fc1c.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gc.c | 13 | ||||
-rw-r--r-- | signal.c | 6 | ||||
-rw-r--r-- | version.h | 6 |
4 files changed, 23 insertions, 10 deletions
@@ -1,3 +1,11 @@ +Sat Jun 14 00:09:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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@dotrb.org> * rational.c (nurat_equal_p): Rational(0,x) and 0 are equivalent, @@ -179,6 +179,7 @@ typedef struct rb_objspace { } 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 @@ static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}}; #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_stack_start = 0; 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 @@ rb_memerror(void) static VALUE gc_stress_get(VALUE self) { + rb_objspace_t *objspace = &rb_objspace; return ruby_gc_stress ? Qtrue : Qfalse; } @@ -307,6 +310,7 @@ gc_stress_get(VALUE self) 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 @@ vm_xmalloc(rb_objspace_t *objspace, size_t size) 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 @@ vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size) } 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 @@ rb_newobj_from_heap(rb_objspace_t *objspace) { 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(); } @@ -554,12 +554,12 @@ sigsegv(int sig) { 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"); } } @@ -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[]; |