• Rick Hudson's avatar
    [dev.garbage] runtime: remove heapBitsSweepSpan · 8dda1c4c
    Rick Hudson authored
    Prior to this CL the sweep phase was responsible for locating
    all objects that were about to be freed and calling a function
    to process the object. This was done by the function
    heapBitsSweepSpan. Part of processing included calls to
    tracefree and msanfree as well as counting how many objects
    were freed.
    
    The calls to tracefree and msanfree have been moved into the
    gcmalloc routine and called when the object is about to be
    reallocated. The counting of free objects has been optimized
    using an array based popcnt algorithm and if all the objects
    in a span are free then span is freed.
    
    Similarly the code to locate the next free object has been
    optimized to use an array based ctz (count trailing zero).
    Various hot paths in the allocation logic have been optimized.
    
    At this point the garbage benchmark is within 3% of the 1.6
    release.
    
    Change-Id: I00643c442e2ada1685c010c3447e4ea8537d2dfa
    Reviewed-on: https://go-review.googlesource.com/20201Reviewed-by: default avatarAustin Clements <austin@google.com>
    8dda1c4c
mgcsweep.go 11.9 KB