OSDN Git Service

Change strategy for freeing objects in the sweep.
authorBarry Hayes <bhayes@google.com>
Wed, 20 May 2009 19:10:36 +0000 (12:10 -0700)
committerJean-Baptiste Queru <jbq@google.com>
Fri, 7 Aug 2009 23:36:27 +0000 (16:36 -0700)
commitdde8ab037540aaec554a471d67613b959cc0e9f4
tree9eb7b7046f879f861006b2680c0f829ae09e0886
parent1d24288d662786dc5374de7615b0b550cc035068
Change strategy for freeing objects in the sweep.

dlfree() in dlmalloc.c is fairly expensive. It checks the previous and
next block to see if the curent block can be merged into one of the
free blocks, and if it does merge, that involves manipulating the
internal free lists.

The sweep phase of the GC is already visiting free objects in address
order, and has a list of objects to be freed. The new strategy is:

Loop over the list of objects to be freed, merging when possible, and
only calling free() when a either the list has run out or a
non-adjacent free object is found.
vm/alloc/HeapSource.c
vm/alloc/HeapSource.h
vm/alloc/MarkSweep.c