diff options
author | Austin Clements <austin@google.com> | 2017-12-18 20:35:34 -0800 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2018-02-15 21:12:22 +0000 |
commit | 45ffeab549fa4b03b231a0872025364e13c7f7f0 (patch) | |
tree | 540a0326b7838f62c26fd1ce10b8116ecda5f8af /src/runtime/mwbbuf.go | |
parent | d6e821858157b7cb4ece22fcc1a5c8604478ebaa (diff) | |
download | go-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/mwbbuf.go')
-rw-r--r-- | src/runtime/mwbbuf.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/runtime/mwbbuf.go b/src/runtime/mwbbuf.go index 13b161ebde..c02ccd8ab7 100644 --- a/src/runtime/mwbbuf.go +++ b/src/runtime/mwbbuf.go @@ -232,9 +232,8 @@ func wbBufFlush1(_p_ *p) { // un-shaded stacks and flush after each stack scan. gcw := &_p_.gcw pos := 0 - arenaStart := mheap_.arena_start for _, ptr := range ptrs { - if ptr < arenaStart { + if ptr < minLegalPointer { // nil pointers are very common, especially // for the "old" values. Filter out these and // other "obvious" non-heap pointers ASAP. |