runtime: integrate new page allocator into runtime

This change integrates all the bits and pieces of the new page allocator
into the runtime, behind a global constant.

Updates #35112.

Change-Id: I6696bde7bab098a498ab37ed2a2caad2a05d30ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/201764
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Michael Anthony Knyszek 2019-10-17 17:42:15 +00:00 committed by Michael Knyszek
parent 21445b091e
commit 689f6f77f0
6 changed files with 199 additions and 19 deletions

View file

@ -176,6 +176,23 @@ func TestPhysicalMemoryUtilization(t *testing.T) {
}
}
func TestScavengedBitsCleared(t *testing.T) {
if OldPageAllocator {
// This test is only relevant for the new page allocator.
return
}
var mismatches [128]BitsMismatch
if n, ok := CheckScavengedBitsCleared(mismatches[:]); !ok {
t.Errorf("uncleared scavenged bits")
for _, m := range mismatches[:n] {
t.Logf("\t@ address 0x%x", m.Base)
t.Logf("\t| got: %064b", m.Got)
t.Logf("\t| want: %064b", m.Want)
}
t.FailNow()
}
}
type acLink struct {
x [1 << 20]byte
}