OSDN Git Service
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.