* gc.c: use size_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bfa6c6b41b
commit
8c79b8b6b8
@ -1,3 +1,7 @@
|
|||||||
|
Tue Jun 14 11:02:08 2011 Narihiro Nakamura <narihiro@netlab.jp>
|
||||||
|
|
||||||
|
* gc.c: use size_t.
|
||||||
|
|
||||||
Tue Jun 14 01:10:38 2011 Yusuke Endoh <mame@tsg.ne.jp>
|
Tue Jun 14 01:10:38 2011 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* test/coverage/test_coverage.rb: add a test for restart. a patch
|
* test/coverage/test_coverage.rb: add a test for restart. a patch
|
||||||
|
20
gc.c
20
gc.c
@ -1068,13 +1068,9 @@ assign_heap_slot(rb_objspace_t *objspace)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_heap_slots(rb_objspace_t *objspace, int add)
|
add_heap_slots(rb_objspace_t *objspace, size_t add)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (add < 1) {
|
|
||||||
add = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((heaps_used + add) > heaps_length) {
|
if ((heaps_used + add) > heaps_length) {
|
||||||
allocate_sorted_heaps(objspace, heaps_used + add);
|
allocate_sorted_heaps(objspace, heaps_used + add);
|
||||||
@ -1088,10 +1084,7 @@ add_heap_slots(rb_objspace_t *objspace, int add)
|
|||||||
static void
|
static void
|
||||||
init_heap(rb_objspace_t *objspace)
|
init_heap(rb_objspace_t *objspace)
|
||||||
{
|
{
|
||||||
int add;
|
add_heap_slots(objspace, HEAP_MIN_SLOTS / HEAP_OBJ_LIMIT);
|
||||||
|
|
||||||
add = HEAP_MIN_SLOTS / HEAP_OBJ_LIMIT;
|
|
||||||
add_heap_slots(objspace, add);
|
|
||||||
|
|
||||||
heaps_inc = 0;
|
heaps_inc = 0;
|
||||||
objspace->profile.invoke_time = getrusage_time();
|
objspace->profile.invoke_time = getrusage_time();
|
||||||
@ -1102,11 +1095,10 @@ init_heap(rb_objspace_t *objspace)
|
|||||||
static void
|
static void
|
||||||
initial_expand_heap(rb_objspace_t *objspace)
|
initial_expand_heap(rb_objspace_t *objspace)
|
||||||
{
|
{
|
||||||
int add;
|
size_t min_size = initial_heap_min_slots / HEAP_OBJ_LIMIT;
|
||||||
|
|
||||||
add = ((initial_heap_min_slots / HEAP_OBJ_LIMIT) - heaps_used);
|
if (min_size > heaps_used) {
|
||||||
if (add > 0) {
|
add_heap_slots(objspace, min_size - heaps_used);
|
||||||
add_heap_slots(objspace, add);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user