mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: remove the allocheaders GOEXPERIMENT
This change removes the allocheaders, deleting all the old code and merging mbitmap_allocheaders.go back into mbitmap.go. This change also deletes the SetType benchmarks which were already broken in the new GOEXPERIMENT (it's harder to set up than before). We weren't really watching these benchmarks at all, and they don't provide additional test coverage. Change-Id: I135497201c3259087c5cd3722ed3fbe24791d25d Reviewed-on: https://go-review.googlesource.com/c/go/+/567200 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
9f13665088
commit
9f3f4c64db
23 changed files with 1393 additions and 2841 deletions
|
|
@ -11,7 +11,6 @@ package runtime
|
|||
import (
|
||||
"internal/cpu"
|
||||
"internal/goarch"
|
||||
"internal/goexperiment"
|
||||
"internal/runtime/atomic"
|
||||
"runtime/internal/sys"
|
||||
"unsafe"
|
||||
|
|
@ -240,9 +239,6 @@ var mheap_ mheap
|
|||
type heapArena struct {
|
||||
_ sys.NotInHeap
|
||||
|
||||
// heapArenaPtrScalar contains pointer/scalar data about the heap for this heap arena.
|
||||
heapArenaPtrScalar
|
||||
|
||||
// spans maps from virtual address page ID within this arena to *mspan.
|
||||
// For allocated spans, their pages map to the span itself.
|
||||
// For free spans, only the lowest and highest pages map to the span itself.
|
||||
|
|
@ -1397,8 +1393,8 @@ func (h *mheap) initSpan(s *mspan, typ spanAllocType, spanclass spanClass, base,
|
|||
s.divMul = 0
|
||||
} else {
|
||||
s.elemsize = uintptr(class_to_size[sizeclass])
|
||||
if goexperiment.AllocHeaders && !s.spanclass.noscan() && heapBitsInSpan(s.elemsize) {
|
||||
// In the allocheaders experiment, reserve space for the pointer/scan bitmap at the end.
|
||||
if !s.spanclass.noscan() && heapBitsInSpan(s.elemsize) {
|
||||
// Reserve space for the pointer/scan bitmap at the end.
|
||||
s.nelems = uint16((nbytes - (nbytes / goarch.PtrSize / 8)) / s.elemsize)
|
||||
} else {
|
||||
s.nelems = uint16(nbytes / s.elemsize)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue