diff options
Diffstat (limited to 'src/runtime/mpagealloc_32bit.go')
| -rw-r--r-- | src/runtime/mpagealloc_32bit.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/runtime/mpagealloc_32bit.go b/src/runtime/mpagealloc_32bit.go index e072f70cd7..859c61d8a5 100644 --- a/src/runtime/mpagealloc_32bit.go +++ b/src/runtime/mpagealloc_32bit.go @@ -11,7 +11,10 @@ package runtime -import "unsafe" +import ( + "runtime/internal/atomic" + "unsafe" +) const ( // The number of levels in the radix tree. @@ -53,6 +56,10 @@ var levelLogPages = [summaryLevels]uint{ logPallocChunkPages, } +// scavengeIndexArray is the backing store for p.scav.index.chunks. +// On 32-bit platforms, it's small enough to just be a global. +var scavengeIndexArray [((1 << heapAddrBits) / pallocChunkBytes) / 8]atomic.Uint8 + // See mpagealloc_64bit.go for details. func (p *pageAlloc) sysInit() { // Calculate how much memory all our entries will take up. @@ -87,6 +94,9 @@ func (p *pageAlloc) sysInit() { reservation = add(reservation, uintptr(entries)*pallocSumBytes) } + + // Set up the scavenge index. + p.scav.index.chunks = scavengeIndexArray[:] } // See mpagealloc_64bit.go for details. |
