checkBucket uintptr
}
+// tophash calculates the tophash value for hash.
+func tophash(hash uintptr) uint8 {
+ top := uint8(hash >> (sys.PtrSize*8 - 8))
+ if top < minTopHash {
+ top += minTopHash
+ }
+ return top
+}
+
func evacuated(b *bmap) bool {
h := b.tophash[0]
return h > empty && h < minTopHash
b = oldb
}
}
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {
b = oldb
}
}
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {
b = oldb
}
}
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
var inserti *uint8
var insertk unsafe.Pointer
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {
} else {
hash &^= newbit
}
- top = uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top = tophash(hash)
}
if hash&newbit != 0 {
useY = 1
b = oldb
}
}
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {
b = oldb
}
}
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
var inserti *uint8
var insertk unsafe.Pointer
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
var inserti *uint8
var insertk unsafe.Pointer
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
var inserti *uint8
var insertk unsafe.Pointer
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
- top := uint8(hash >> (sys.PtrSize*8 - 8))
- if top < minTopHash {
- top += minTopHash
- }
+ top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
if b.tophash[i] != top {