]> Cypherpunks repositories - gostls13.git/commit
[dev.garbage] runtime: restructure alloc and mark bits
authorRick Hudson <rlh@golang.org>
Mon, 14 Mar 2016 16:17:48 +0000 (12:17 -0400)
committerRick Hudson <rlh@golang.org>
Fri, 29 Apr 2016 00:00:47 +0000 (00:00 +0000)
commit2063d5d903718962de58a86a692626fe89919a4d
tree45f21ec57964d391bd55594377c025e5dae03291
parent23aeb34df172b17b7bfaa85fb59ca64bef9073bb
[dev.garbage] runtime: restructure alloc and mark bits

Two changes are included here that are dependent on the other.
The first is that allocBits and gcamrkBits are changed to
a *uint8 which points to the first byte of that span's
mark and alloc bits. Several places were altered to
perform pointer arithmetic to locate the byte corresponding
to an object in the span. The actual bit corresponding
to an object is indexed in the byte by using the lower three
bits of the objects index.

The second change avoids the redundant calculation of an
object's index. The index is returned from heapBitsForObject
and then used by the functions indexing allocBits
and gcmarkBits.

Finally we no longer allocate the gc bits in the span
structures. Instead we use an arena based allocation scheme
that allows for a more compact bit map as well as recycling
and bulk clearing of the mark bits.

Change-Id: If4d04b2021c092ec39a4caef5937a8182c64dfef
Reviewed-on: https://go-review.googlesource.com/20705
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/cgocall.go
src/runtime/malloc.go
src/runtime/mbitmap.go
src/runtime/mgcmark.go
src/runtime/mgcsweep.go
src/runtime/mheap.go