diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-23 05:58:15 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-23 05:58:15 +0000 |
commit | 5cb55eca6fac360c94fd5fa54566609dfc3db45c (patch) | |
tree | a33fbc7ba40f327502b8dc5395f74660c4924781 | |
parent | 2c772139b60ddc71d126f42dca37f3c3e5af1caa (diff) | |
download | ruby-5cb55eca6fac360c94fd5fa54566609dfc3db45c.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gc.c | 9 |
2 files changed, 16 insertions, 0 deletions
@@ -1,3 +1,10 @@ +Mon Mar 23 14:57:48 2009 Narihiro Nakamura <authorNari@gmail.com> + + * 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@ruby-lang.org> * win32/win32.c (rb_w32_spawn): use original command if not found. @@ -922,6 +922,10 @@ init_heap(rb_objspace_t *objspace) 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 @@ static void 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) { |