diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-16 08:46:15 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-16 08:46:15 +0000 |
commit | ed621c001e20b8f6fec152c76360371d8fed38c5 (patch) | |
tree | 89583af95aa1c3acdc3ec4889c82e4a776a3f17f /gc.c | |
parent | 73ee1676b0cd82db62a577bf6ac69fc5b7e00c92 (diff) | |
download | ruby-ed621c001e20b8f6fec152c76360371d8fed38c5.tar.gz |
* gc.c (link_free_heap_slot): removed.
* gc.c (slot_sweep): use `heaps_add_freeslot' instead of
`link_free_heap_slot'.
* gc.c (assign_heap_slot): use local variable `slot' instead of
`heaps'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 23 |
1 files changed, 8 insertions, 15 deletions
@@ -733,13 +733,6 @@ allocate_sorted_heaps(rb_objspace_t *objspace, size_t next_heaps_length) } static void -link_free_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot) -{ - slot->free_next = objspace->heap.free_slots; - objspace->heap.free_slots = slot; -} - -static void unlink_free_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot) { objspace->heap.free_slots = slot->free_next; @@ -791,8 +784,8 @@ assign_heap_slot(rb_objspace_t *objspace) MEMZERO((void*)slot, struct heaps_slot, 1); slot->header = header; - slot->next = objspace->heap.ptr; + slot->next = objspace->heap.ptr; if (objspace->heap.ptr) objspace->heap.ptr->prev = slot; objspace->heap.ptr = slot; @@ -841,7 +834,7 @@ assign_heap_slot(rb_objspace_t *objspace) slot_add_freeobj(objspace, slot, (VALUE)p); } - heaps_add_freeslot(objspace, heaps); + heaps_add_freeslot(objspace, slot); } static void @@ -2294,12 +2287,12 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot) unlink_heap_slot(objspace, sweep_slot); } else { - if (freed_num + empty_num > 0) { - link_free_heap_slot(objspace, sweep_slot); - } - else { - sweep_slot->free_next = NULL; - } + if (freed_num + empty_num > 0) { + heaps_add_freeslot(objspace, sweep_slot); + } + else { + sweep_slot->free_next = NULL; + } objspace->heap.free_num += freed_num + empty_num; } objspace->total_freed_object_num += freed_num; |