Source File
mpagealloc_64bit.go
Belonging Package
runtime
package runtime
import
summaryLevels = 5
pageAlloc32Bit = 0
pageAlloc64Bit = 1
pallocChunksL1Bits = 13
)
var levelShift = [summaryLevels]uint{
heapAddrBits - summaryL0Bits,
heapAddrBits - summaryL0Bits - 1*summaryLevelBits,
heapAddrBits - summaryL0Bits - 2*summaryLevelBits,
heapAddrBits - summaryL0Bits - 3*summaryLevelBits,
heapAddrBits - summaryL0Bits - 4*summaryLevelBits,
}
for , := range levelShift {
:= 1 << (heapAddrBits - )
:= alignUp(uintptr()*pallocSumBytes, physPageSize)
:= sysReserve(nil, )
if == nil {
throw("failed to reserve page summary memory")
}
func ( *pageAlloc) (, uintptr) {
if %pallocChunkBytes != 0 || %pallocChunkBytes != 0 {
print("runtime: base = ", hex(), ", limit = ", hex(), "\n")
throw("sysGrow bounds not aligned to pallocChunkBytes")
}
:= func( int, addrRange) (int, int) {
, := addrsToSummaryRange(, .base.addr(), .limit.addr())
return blockAlignSummaryRange(, , )
}
:= func(, , int) addrRange {
:= alignDown(uintptr()*pallocSumBytes, physPageSize)
:= alignUp(uintptr()*pallocSumBytes, physPageSize)
:= unsafe.Pointer(&.summary[][0])
return addrRange{
offAddr{uintptr(add(, ))},
offAddr{uintptr(add(, ))},
}
}
, := (, makeAddrRange(, ))
:= (, , )
if .size() == 0 {
continue
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |