1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gc.c (gc_before_heap_sweep): Restructure code to mean clearly.

heap->freelist is connected to end of list.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tarui 2013-10-25 21:37:39 +00:00
parent 7518f59cbe
commit 59735e2c61
2 changed files with 9 additions and 11 deletions

View file

@ -1,3 +1,8 @@
Sat Oct 26 06:35:41 2013 Masaya Tarui <tarui@ruby-lang.org>
* gc.c (gc_before_heap_sweep): Restructure code to mean clearly.
heap->freelist is connected to end of list.
Sat Oct 26 04:01:35 2013 Koichi Sasada <ko1@atdot.net>
* gc.c (gc_before_heap_sweep): fix freelist management.

15
gc.c
View file

@ -2483,18 +2483,11 @@ gc_before_heap_sweep(rb_objspace_t *objspace, rb_heap_t *heap)
heap->free_pages = NULL;
if (heap->using_page) {
if (heap->using_page->freelist) {
RVALUE *pstart = heap->using_page->freelist;
RVALUE *p = heap->using_page->freelist;
while (p->as.free.next) {
p = p->as.free.next;
}
p->as.free.next = heap->freelist;
heap->using_page->freelist = pstart;
}
else {
heap->using_page->freelist = heap->freelist;
RVALUE **p = &heap->using_page->freelist;
while (*p) {
p = &(*p)->as.free.next;
}
*p = heap->freelist;
heap->using_page = NULL;
}
heap->freelist = NULL;