diff options
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 } |
