runtime: add new page allocator core

This change adds a new bitmap-based allocator to the runtime with tests.
It does not yet integrate the page allocator into the runtime and thus
this change is almost purely additive.

Updates #35112.

Change-Id: Ic3d024c28abee8be8797d3918116a80f901cc2bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/190622
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-08-14 16:32:12 +00:00 committed by Michael Knyszek
parent 05aa4a7b74
commit 39e8cb0faa
6 changed files with 1716 additions and 2 deletions

View file

@ -13,7 +13,7 @@ import (
// Ensures that got and want are the same, and if not, reports
// detailed diff information.
func checkPallocBits(t *testing.T, got, want *PallocBits) {
func checkPallocBits(t *testing.T, got, want *PallocBits) bool {
d := DiffPallocBits(got, want)
if len(d) != 0 {
t.Errorf("%d range(s) different", len(d))
@ -22,7 +22,9 @@ func checkPallocBits(t *testing.T, got, want *PallocBits) {
t.Logf("\t| got: %s", StringifyPallocBits(got, bits))
t.Logf("\t| want: %s", StringifyPallocBits(want, bits))
}
return false
}
return true
}
// makePallocBits produces an initialized PallocBits by setting