ruby-changes:6236
From: nobu <ko1@a...>
Date: Tue, 1 Jul 2008 00:49:31 +0900 (JST)
Subject: [ruby-changes:6236] Ruby:r17748 (trunk): * gc.c (rb_newobj): abort GC phase before rb_bug.
nobu 2008-07-01 00:49:13 +0900 (Tue, 01 Jul 2008)
New Revision: 17748
Modified files:
trunk/ChangeLog
trunk/gc.c
Log:
* gc.c (rb_newobj): abort GC phase before rb_bug.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=17748
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17748&r2=17747&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/gc.c?r1=17748&r2=17747&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 17747)
+++ ChangeLog (revision 17748)
@@ -1,3 +1,7 @@
+Tue Jul 1 00:49:11 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * gc.c (rb_newobj): abort GC phase before rb_bug.
+
Mon Jun 30 23:15:07 2008 Yusuke Endoh <mame@t...>
* test/openssl/test_ssl.rb (start_server): shutdown TCPServer before
Index: gc.c
===================================================================
--- gc.c (revision 17747)
+++ gc.c (revision 17748)
@@ -705,18 +705,25 @@
VALUE
rb_newobj(void)
{
+#if USE_VALUE_CACHE || (defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE)
+ rb_thread_t *th = GET_THREAD();
+#endif
#if USE_VALUE_CACHE
- rb_thread_t *th = GET_THREAD();
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 @@
#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 @@
if (end <= start) return;
n = end - start;
- mark_locations_array(&rb_objspace, start,n);
+ mark_locations_array(objspace, start, n);
}
void
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/