зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
3ac2c3472a
Коммит
01a025d2d7
|
@ -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>
|
Mon Jun 30 23:15:07 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* test/openssl/test_ssl.rb (start_server): shutdown TCPServer before
|
* test/openssl/test_ssl.rb (start_server): shutdown TCPServer before
|
||||||
|
|
16
gc.c
16
gc.c
|
@ -705,18 +705,25 @@ rb_fill_value_cache(rb_thread_t *th)
|
||||||
VALUE
|
VALUE
|
||||||
rb_newobj(void)
|
rb_newobj(void)
|
||||||
{
|
{
|
||||||
#if USE_VALUE_CACHE
|
#if USE_VALUE_CACHE || (defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE)
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
|
#endif
|
||||||
|
#if USE_VALUE_CACHE
|
||||||
VALUE v = *th->value_cache_ptr;
|
VALUE v = *th->value_cache_ptr;
|
||||||
|
#endif
|
||||||
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
||||||
rb_objspace_t *objspace = th->vm->objspace;
|
rb_objspace_t *objspace = th->vm->objspace;
|
||||||
#else
|
#else
|
||||||
rb_objspace_t *objspace = &rb_objspace;
|
rb_objspace_t *objspace = &rb_objspace;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (during_gc)
|
if (during_gc) {
|
||||||
|
dont_gc = 1;
|
||||||
|
during_gc = 0;
|
||||||
rb_bug("object allocation during garbage collection phase");
|
rb_bug("object allocation during garbage collection phase");
|
||||||
|
}
|
||||||
|
|
||||||
|
#if USE_VALUE_CACHE
|
||||||
if (v) {
|
if (v) {
|
||||||
RBASIC(v)->flags = 0;
|
RBASIC(v)->flags = 0;
|
||||||
th->value_cache_ptr++;
|
th->value_cache_ptr++;
|
||||||
|
@ -731,9 +738,6 @@ rb_newobj(void)
|
||||||
#endif
|
#endif
|
||||||
return v;
|
return v;
|
||||||
#else
|
#else
|
||||||
rb_objspace_t *objspace = &rb_objspace;
|
|
||||||
if (during_gc)
|
|
||||||
rb_bug("object allocation during garbage collection phase");
|
|
||||||
return rb_newobj_from_heap(objspace);
|
return rb_newobj_from_heap(objspace);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -920,7 +924,7 @@ gc_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end)
|
||||||
|
|
||||||
if (end <= start) return;
|
if (end <= start) return;
|
||||||
n = end - start;
|
n = end - start;
|
||||||
mark_locations_array(&rb_objspace, start,n);
|
mark_locations_array(objspace, start, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Загрузка…
Ссылка в новой задаче