Change-Id: I63824721f4bbc08462b5de7843125d9b3205c1fe
This commit is contained in:
qiulaidongfeng 2024-01-31 10:10:58 +08:00
parent 458379d6f9
commit bbab8d1142
3 changed files with 5 additions and 5 deletions

View File

@ -828,7 +828,7 @@ func expandGoroot(s string) string {
const (
SUBBUCKETS = 16
SUBBUCKETSIZE = abi.Pcbucketsize / SUBBUCKETS
SUBBUCKETSIZE = abi.FuncTabBucketSize / SUBBUCKETS
NOIDX = 0x7fffffff
)
@ -846,7 +846,7 @@ func (ctxt *Link) findfunctab(state *pclntab, container loader.Bitmap) {
// that map to that subbucket.
n := int32((max - min + SUBBUCKETSIZE - 1) / SUBBUCKETSIZE)
nbuckets := int32((max - min + abi.Pcbucketsize - 1) / abi.Pcbucketsize)
nbuckets := int32((max - min + abi.FuncTabBucketSize - 1) / abi.FuncTabBucketSize)
size := 4*int64(nbuckets) + int64(n)

View File

@ -108,4 +108,4 @@ const (
const MINFUNC = 16 // minimum size for a function
const Pcbucketsize = 256 * MINFUNC // size of bucket in the pc->func lookup table
const FuncTabBucketSize = 256 * MINFUNC // size of bucket in the pc->func lookup table

View File

@ -778,8 +778,8 @@ func findfunc(pc uintptr) funcInfo {
}
x := uintptr(pcOff) + datap.text - datap.minpc // TODO: are datap.text and datap.minpc always equal?
b := x / abi.Pcbucketsize
i := x % abi.Pcbucketsize / (abi.Pcbucketsize / nsub)
b := x / abi.FuncTabBucketSize
i := x % abi.FuncTabBucketSize / (abi.FuncTabBucketSize / nsub)
ffb := (*findfuncbucket)(add(unsafe.Pointer(datap.findfunctab), b*unsafe.Sizeof(findfuncbucket{})))
idx := ffb.idx + uint32(ffb.subbuckets[i])