diff options
| author | Michael Anthony Knyszek <mknyszek@google.com> | 2019-08-12 22:30:39 +0000 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2019-11-07 16:20:25 +0000 |
| commit | 14849f0fa57c67996bb00bd42bb14cef9f4e9a1e (patch) | |
| tree | 7dbef5d83aa016fa38c6138985e5510d57cdea9b /src/runtime/mpagealloc_32bit.go | |
| parent | 0bf2eb5d4d1ee166d7649258da61e4712a05f383 (diff) | |
| download | go-14849f0fa57c67996bb00bd42bb14cef9f4e9a1e.tar.xz | |
runtime: add new page allocator constants and description
This change is the first of a series of changes which replace the
current page allocator (which is based on the contents of mgclarge.go
and some of mheap.go) with one based on free/used bitmaps.
It adds in the key constants for the page allocator as well as a comment
describing the implementation.
Updates #35112.
Change-Id: I839d3a07f46842ad379701d27aa691885afdba63
Reviewed-on: https://go-review.googlesource.com/c/go/+/190619
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/mpagealloc_32bit.go')
| -rw-r--r-- | src/runtime/mpagealloc_32bit.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/runtime/mpagealloc_32bit.go b/src/runtime/mpagealloc_32bit.go new file mode 100644 index 0000000000..c91b2bbe3f --- /dev/null +++ b/src/runtime/mpagealloc_32bit.go @@ -0,0 +1,23 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build 386 arm mips mipsle wasm darwin,arm64 + +// wasm is a treated as a 32-bit architecture for the purposes of the page +// allocator, even though it has 64-bit pointers. This is because any wasm +// pointer always has its top 32 bits as zero, so the effective heap address +// space is only 2^32 bytes in size (see heapAddrBits). + +// darwin/arm64 is treated as a 32-bit architecture for the purposes of the +// page allocator, even though it has 64-bit pointers and a 33-bit address +// space (see heapAddrBits). The 33 bit address space cannot be rounded up +// to 64 bits because there are too many summary levels to fit in just 33 +// bits. + +package runtime + +const ( + // The number of levels in the radix tree. + summaryLevels = 4 +) |
