diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-30 15:49:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-30 15:49:13 +0000 |
commit | 01a025d2d73f3f71427027deda4c2f88708c1a05 (patch) | |
tree | 4305dda0f282035818b0bcac55aac1ed93fc1446 /gc.c | |
parent | 3ac2c3472af0dfce9a79ed3ffa6ed720caaf98e2 (diff) | |
download | ruby-01a025d2d73f3f71427027deda4c2f88708c1a05.tar.gz |
* gc.c (rb_newobj): abort GC phase before rb_bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -705,18 +705,25 @@ rb_fill_value_cache(rb_thread_t *th) VALUE rb_newobj(void) { -#if USE_VALUE_CACHE +#if USE_VALUE_CACHE || (defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE) rb_thread_t *th = GET_THREAD(); +#endif +#if USE_VALUE_CACHE VALUE v = *th->value_cache_ptr; +#endif #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE rb_objspace_t *objspace = th->vm->objspace; #else rb_objspace_t *objspace = &rb_objspace; #endif - if (during_gc) - rb_bug("object allocation during garbage collection phase"); + if (during_gc) { + dont_gc = 1; + during_gc = 0; + rb_bug("object allocation during garbage collection phase"); + } +#if USE_VALUE_CACHE if (v) { RBASIC(v)->flags = 0; th->value_cache_ptr++; @@ -731,9 +738,6 @@ rb_newobj(void) #endif return v; #else - rb_objspace_t *objspace = &rb_objspace; - if (during_gc) - rb_bug("object allocation during garbage collection phase"); return rb_newobj_from_heap(objspace); #endif } @@ -920,7 +924,7 @@ gc_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end) if (end <= start) return; n = end - start; - mark_locations_array(&rb_objspace, start,n); + mark_locations_array(objspace, start, n); } void |