diff options
author | Michael Anthony Knyszek <mknyszek@google.com> | 2019-10-17 17:42:15 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2019-11-07 20:14:02 +0000 |
commit | 689f6f77f0d54b597ebc82e9bc4a8e1a59bce04d (patch) | |
tree | f1cdd32b56fa969b849d7f236dc8ebd05c219dc2 /src/runtime/malloc_test.go | |
parent | 21445b091ec0a0625282603e2730d10b34396375 (diff) | |
download | go-689f6f77f0d54b597ebc82e9bc4a8e1a59bce04d.tar.gz go-689f6f77f0d54b597ebc82e9bc4a8e1a59bce04d.zip |
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>
Diffstat (limited to 'src/runtime/malloc_test.go')
-rw-r--r-- | src/runtime/malloc_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/runtime/malloc_test.go b/src/runtime/malloc_test.go index a2d5864d3d..9831dbe079 100644 --- a/src/runtime/malloc_test.go +++ b/src/runtime/malloc_test.go @@ -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 } |