ruby-changes:11413
From: nari <ko1@a...>
Date: Mon, 23 Mar 2009 14:59:26 +0900 (JST)
Subject: [ruby-changes:11413] Ruby:r23037 (trunk): * gc.c (init_heap): set default to heap slots length
nari 2009-03-23 14:58:15 +0900 (Mon, 23 Mar 2009) New Revision: 23037 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23037 Log: * gc.c (init_heap): set default to heap slots length if HEAP_OBJ_LIMIT is larger than HEAP_MIN_SLOTS. [Bug #1310] (set_heaps_increment): increment next_heaps_length if next_heaps_length and heaps_used are same. Modified files: trunk/ChangeLog trunk/gc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 23036) +++ ChangeLog (revision 23037) @@ -1,3 +1,10 @@ +Mon Mar 23 14:57:48 2009 Narihiro Nakamura <authorNari@g...> + + * gc.c (init_heap): set default to heap slots length + if HEAP_OBJ_LIMIT is larger than HEAP_MIN_SLOTS. [Bug #1310] + (set_heaps_increment): increment next_heaps_length if + next_heaps_length and heaps_used are same. + Mon Mar 23 14:32:23 2009 Nobuyoshi Nakada <nobu@r...> * win32/win32.c (rb_w32_spawn): use original command if not found. Index: gc.c =================================================================== --- gc.c (revision 23036) +++ gc.c (revision 23037) @@ -922,6 +922,10 @@ add = HEAP_MIN_SLOTS / HEAP_OBJ_LIMIT; + if (!add) { + add = 1; + } + if ((heaps_used + add) > heaps_length) { allocate_heaps(objspace, heaps_used + add); } @@ -938,6 +942,11 @@ set_heaps_increment(rb_objspace_t *objspace) { size_t next_heaps_length = (size_t)(heaps_used * 1.8); + + if (next_heaps_length == heaps_used) { + next_heaps_length++; + } + heaps_inc = next_heaps_length - heaps_used; if (next_heaps_length > heaps_length) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/