зеркало из https://github.com/github/ruby.git
* 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:
Родитель
73ee1676b0
Коммит
ed621c001e
10
ChangeLog
10
ChangeLog
|
@ -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>
|
||||
|
||||
* gc.c (assign_heap_slot): refactoring variable names.
|
||||
|
|
23
gc.c
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
|
||||
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);
|
||||
|
||||
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче