diff options
| author | Michael Anthony Knyszek <mknyszek@google.com> | 2024-04-09 03:41:06 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-04-09 04:07:57 +0000 |
| commit | 9f3f4c64dbfd37ef9f7113708a706a8099d72fd9 (patch) | |
| tree | 05048ee9895b3a6866c86f128ef3a6b84a54d493 /src/runtime/msize_allocheaders.go | |
| parent | 9f13665088012298146c573bc2a7255b1caf2750 (diff) | |
| download | go-9f3f4c64dbfd37ef9f7113708a706a8099d72fd9.tar.xz | |
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>
Diffstat (limited to 'src/runtime/msize_allocheaders.go')
| -rw-r--r-- | src/runtime/msize_allocheaders.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/runtime/msize_allocheaders.go b/src/runtime/msize_allocheaders.go deleted file mode 100644 index 6873ec66d9..0000000000 --- a/src/runtime/msize_allocheaders.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build goexperiment.allocheaders - -// Malloc small size classes. -// -// See malloc.go for overview. -// See also mksizeclasses.go for how we decide what size classes to use. - -package runtime - -// Returns size of the memory block that mallocgc will allocate if you ask for the size, -// minus any inline space for metadata. -func roundupsize(size uintptr, noscan bool) (reqSize uintptr) { - reqSize = size - if reqSize <= maxSmallSize-mallocHeaderSize { - // Small object. - if !noscan && reqSize > minSizeForMallocHeader { // !noscan && !heapBitsInSpan(reqSize) - reqSize += mallocHeaderSize - } - // (reqSize - size) is either mallocHeaderSize or 0. We need to subtract mallocHeaderSize - // from the result if we have one, since mallocgc will add it back in. - if reqSize <= smallSizeMax-8 { - return uintptr(class_to_size[size_to_class8[divRoundUp(reqSize, smallSizeDiv)]]) - (reqSize - size) - } - return uintptr(class_to_size[size_to_class128[divRoundUp(reqSize-smallSizeMax, largeSizeDiv)]]) - (reqSize - size) - } - // Large object. Align reqSize up to the next page. Check for overflow. - reqSize += pageSize - 1 - if reqSize < size { - return size - } - return reqSize &^ (pageSize - 1) -} |
