aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mbitmap.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-12-18 20:35:34 -0800
committerAustin Clements <austin@google.com>2018-02-15 21:12:22 +0000
commit45ffeab549fa4b03b231a0872025364e13c7f7f0 (patch)
tree540a0326b7838f62c26fd1ce10b8116ecda5f8af /src/runtime/mbitmap.go
parentd6e821858157b7cb4ece22fcc1a5c8604478ebaa (diff)
downloadgo-45ffeab549fa4b03b231a0872025364e13c7f7f0.tar.gz
go-45ffeab549fa4b03b231a0872025364e13c7f7f0.zip
runtime: eliminate most uses of mheap_.arena_*
This replaces all uses of the mheap_.arena_* fields outside of mallocinit and sysAlloc. These fields fundamentally assume a contiguous heap between two bounds, so eliminating these is necessary for a sparse heap. Many of these are replaced with checks for non-nil spans at the test address (which in turn checks for a non-nil entry in the heap arena array). Some of them are just for debugging and somewhat meaningless with a sparse heap, so those we just delete. Updates #10460. Change-Id: I8345b95ffc610aed694f08f74633b3c63506a41f Reviewed-on: https://go-review.googlesource.com/85886 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/mbitmap.go')
-rw-r--r--src/runtime/mbitmap.go12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go
index 5e109f5906..0027bc9c05 100644
--- a/src/runtime/mbitmap.go
+++ b/src/runtime/mbitmap.go
@@ -308,9 +308,6 @@ func (m markBits) clearMarked() {
// markBitsForSpan returns the markBits for the span base address base.
func markBitsForSpan(base uintptr) (mbits markBits) {
- if base < mheap_.arena_start || base >= mheap_.arena_used {
- throw("markBitsForSpan: base out of range")
- }
mbits = markBitsForAddr(base)
if mbits.mask != 1 {
throw("markBitsForSpan: unaligned start")
@@ -352,15 +349,6 @@ func heapBitsForAddr(addr uintptr) heapBits {
return heapBits{bitp, uint32(off & 3), uint32(arena), last}
}
-// heapBitsForSpan returns the heapBits for the span base address base.
-func heapBitsForSpan(base uintptr) (hbits heapBits) {
- if base < mheap_.arena_start || base >= mheap_.arena_used {
- print("runtime: base ", hex(base), " not in range [", hex(mheap_.arena_start), ",", hex(mheap_.arena_used), ")\n")
- throw("heapBitsForSpan: base out of range")
- }
- return heapBitsForAddr(base)
-}
-
// findObject returns the base address for the heap object containing
// the address p, the object's span, and the index of the object in s.
// If p does not point into a heap object, it returns base == 0.