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 | de1104de3b0db8d5226ac1aed76e1a043dab84c0 (patch) | |
| tree | 4305dda0f282035818b0bcac55aac1ed93fc1446 | |
| parent | 3d90ec1819b693a30d20a12866ae5a438a1bba0b (diff) | |
| download | ruby-de1104de3b0db8d5226ac1aed76e1a043dab84c0.tar.gz ruby-de1104de3b0db8d5226ac1aed76e1a043dab84c0.tar.xz ruby-de1104de3b0db8d5226ac1aed76e1a043dab84c0.zip | |
* gc.c (rb_newobj): abort GC phase before rb_bug.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | gc.c | 18 |
2 files changed, 15 insertions, 7 deletions
@@ -1,3 +1,7 @@ +Tue Jul 1 00:49:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * gc.c (rb_newobj): abort GC phase before rb_bug. + Mon Jun 30 23:15:07 2008 Yusuke Endoh <mame@tsg.ne.jp> * test/openssl/test_ssl.rb (start_server): shutdown TCPServer before @@ -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 |
