]> Cypherpunks repositories - gostls13.git/commit
[dev.garbage] runtime: remove heapBitsSweepSpan
authorRick Hudson <rlh@golang.org>
Wed, 2 Mar 2016 17:15:02 +0000 (12:15 -0500)
committerRick Hudson <rlh@golang.org>
Wed, 27 Apr 2016 21:54:57 +0000 (21:54 +0000)
commit8dda1c4c08adf8b2107dec1c0d70d24443269ccd
tree83cd82a13ce95d7b6da0976bad7d0438d354bc53
parent4093481523b1e064e998d5d586276db45f4d11a7
[dev.garbage] runtime: remove heapBitsSweepSpan

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/20201
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/malloc.go
src/runtime/mbitmap.go
src/runtime/mgcsweep.go
src/runtime/mheap.go