summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-01 12:36:39 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-01 12:36:39 +0000
commit57b9e18d71b50a707d4bc962d8ffabac0e83a18b (patch)
treeb6ddf7f06e0d569f18adb5d7ca3dd7380a50dec0
parent893009f8b8e0c9509b54bd074440dfd6844e01df (diff)
* gc.c (allocate_heaps, assign_heap_slot, rb_newobj_from_heap):
reset during_gc before raising NoMemoryError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--gc.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1749b99..b7e62ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 1 21:36:00 2008 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * gc.c (allocate_heaps, assign_heap_slot, rb_newobj_from_heap):
+ reset during_gc before raising NoMemoryError.
+
Fri Aug 1 21:29:56 2008 Yusuke Endoh <mame@tsg.ne.jp>
* vm.c (Init_BareVM): check failure of malloc().
diff --git a/gc.c b/gc.c
index 6b14d67..27fd988 100644
--- a/gc.c
+++ b/gc.c
@@ -555,7 +555,10 @@ allocate_heaps(rb_objspace_t *objspace, size_t next_heaps_length)
p = heaps = (struct heaps_slot *)malloc(size);
}
);
- if (p == 0) rb_memerror();
+ if (p == 0) {
+ during_gc = 0;
+ rb_memerror();
+ }
heaps_length = next_heaps_length;
}
@@ -568,8 +571,10 @@ assign_heap_slot(rb_objspace_t *objspace)
objs = HEAP_OBJ_LIMIT;
RUBY_CRITICAL(p = (RVALUE*)malloc(HEAP_SIZE));
- if (p == 0)
+ if (p == 0) {
+ during_gc = 0;
rb_memerror();
+ }
membase = p;
if ((VALUE)p % sizeof(RVALUE) != 0) {
@@ -663,6 +668,7 @@ rb_newobj_from_heap(rb_objspace_t *objspace)
if ((ruby_gc_stress && !ruby_disable_gc_stress) || !freelist) {
if (!heaps_increment(objspace) && !garbage_collect(objspace)) {
+ during_gc = 0;
rb_memerror();
}
}