ruby-changes:6791
From: mame <ko1@a...>
Date: Fri, 1 Aug 2008 21:37:02 +0900 (JST)
Subject: [ruby-changes:6791] Ruby:r18307 (trunk): * gc.c (allocate_heaps, assign_heap_slot, rb_newobj_from_heap):
mame 2008-08-01 21:36:39 +0900 (Fri, 01 Aug 2008) New Revision: 18307 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18307 Log: * gc.c (allocate_heaps, assign_heap_slot, rb_newobj_from_heap): reset during_gc before raising NoMemoryError. Modified files: trunk/ChangeLog trunk/gc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18306) +++ ChangeLog (revision 18307) @@ -1,3 +1,8 @@ +Fri Aug 1 21:36:00 2008 Yusuke Endoh <mame@t...> + + * 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@t...> * vm.c (Init_BareVM): check failure of malloc(). Index: gc.c =================================================================== --- gc.c (revision 18306) +++ gc.c (revision 18307) @@ -555,7 +555,10 @@ 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 @@ 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 @@ if ((ruby_gc_stress && !ruby_disable_gc_stress) || !freelist) { if (!heaps_increment(objspace) && !garbage_collect(objspace)) { + during_gc = 0; rb_memerror(); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/