能力值:
( LV15,RANK:1057 )
|
-
-
2 楼
求详细
|
能力值:
( LV13,RANK:923 )
|
-
-
3 楼
po叔还是po叔啊!跪求详解。
|
能力值:
( LV15,RANK:3306 )
|
-
-
4 楼
mark // runtime/malloc.go
func mallocinit() {
// ...
limit = 0
if sys.PtrSize == 8 && (limit == 0 || limit > 1<<30) {
// ...
arenaSize := round(_MaxMem, _PageSize)
bitmapSize = arenaSize / (sys.PtrSize * 8 / 4)
spansSize = arenaSize / _PageSize * sys.PtrSize
spansSize = round(spansSize, _PageSize)
for i := 0; i <= 0x7f; i++ {
switch {
case GOARCH == "arm64" && GOOS == "darwin":
p = uintptr(i)<<40 | uintptrMask&(0x0013<<28)
case GOARCH == "arm64":
p = uintptr(i)<<40 | uintptrMask&(0x0040<<32)
default:
p = uintptr(i)<<40 | uintptrMask&(0x00c0<<32)
}
pSize = bitmapSize + spansSize + arenaSize + _PageSize
p = uintptr(sysReserve(unsafe.Pointer(p), pSize, &reserved))
if p != 0 {
break
}
}
}
// ...
p1 := round(p, _PageSize)
mheap_.spans = (**mspan)(unsafe.Pointer(p1))
mheap_.bitmap = p1 + spansSize
mheap_.arena_start = p1 + (spansSize + bitmapSize) // 0xC820000000
mheap_.arena_used = mheap_.arena_start
mheap_.arena_end = p + pSize
mheap_.arena_reserved = reserved
//...
}
|
能力值:
( LV15,RANK:2663 )
|
-
-
5 楼
我也不太了解。惊现风神,感谢。
|
|
|