* 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
This commit is contained in:
ko1 2013-07-16 08:46:15 +00:00
Родитель 73ee1676b0
Коммит ed621c001e
2 изменённых файлов: 18 добавлений и 15 удалений

Просмотреть файл

@ -1,3 +1,13 @@
Tue Jul 16 17:43:22 2013 Koichi Sasada <ko1@atdot.net>
* 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'.
Tue Jul 16 17:21:39 2013 Koichi Sasada <ko1@atdot.net> Tue Jul 16 17:21:39 2013 Koichi Sasada <ko1@atdot.net>
* gc.c (assign_heap_slot): refactoring variable names. * gc.c (assign_heap_slot): refactoring variable names.

23
gc.c
Просмотреть файл

@ -732,13 +732,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 static void
unlink_free_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot) unlink_free_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot)
{ {
@ -791,8 +784,8 @@ assign_heap_slot(rb_objspace_t *objspace)
MEMZERO((void*)slot, struct heaps_slot, 1); MEMZERO((void*)slot, struct heaps_slot, 1);
slot->header = header; slot->header = header;
slot->next = objspace->heap.ptr;
slot->next = objspace->heap.ptr;
if (objspace->heap.ptr) objspace->heap.ptr->prev = slot; if (objspace->heap.ptr) objspace->heap.ptr->prev = slot;
objspace->heap.ptr = slot; objspace->heap.ptr = slot;
@ -841,7 +834,7 @@ assign_heap_slot(rb_objspace_t *objspace)
slot_add_freeobj(objspace, slot, (VALUE)p); slot_add_freeobj(objspace, slot, (VALUE)p);
} }
heaps_add_freeslot(objspace, heaps); heaps_add_freeslot(objspace, slot);
} }
static void static void
@ -2294,12 +2287,12 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
unlink_heap_slot(objspace, sweep_slot); unlink_heap_slot(objspace, sweep_slot);
} }
else { else {
if (freed_num + empty_num > 0) { if (freed_num + empty_num > 0) {
link_free_heap_slot(objspace, sweep_slot); heaps_add_freeslot(objspace, sweep_slot);
} }
else { else {
sweep_slot->free_next = NULL; sweep_slot->free_next = NULL;
} }
objspace->heap.free_num += freed_num + empty_num; objspace->heap.free_num += freed_num + empty_num;
} }
objspace->total_freed_object_num += freed_num; objspace->total_freed_object_num += freed_num;