-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathexport_test.go
80 lines (62 loc) · 1.56 KB
/
export_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package xsync
const (
EntriesPerMapBucket = entriesPerMapBucket
EntriesPerMapOfBucket = entriesPerMapOfBucket
MapLoadFactor = mapLoadFactor
DefaultMinMapTableLen = defaultMinMapTableLen
DefaultMinMapTableCap = defaultMinMapTableLen * entriesPerMapBucket
DefaultMinMapOfTableCap = defaultMinMapTableLen * entriesPerMapOfBucket
MaxMapCounterLen = maxMapCounterLen
)
type (
BucketPadded = bucketPadded
BucketOfPadded = bucketOfPadded
)
func LockBucket(mu *uint64) {
lockBucket(mu)
}
func UnlockBucket(mu *uint64) {
unlockBucket(mu)
}
func TopHashMatch(hash, topHashes uint64, idx int) bool {
return topHashMatch(hash, topHashes, idx)
}
func StoreTopHash(hash, topHashes uint64, idx int) uint64 {
return storeTopHash(hash, topHashes, idx)
}
func EraseTopHash(topHashes uint64, idx int) uint64 {
return eraseTopHash(topHashes, idx)
}
func EnableAssertions() {
assertionsEnabled = true
}
func DisableAssertions() {
assertionsEnabled = false
}
func Fastrand() uint32 {
return runtime_fastrand()
}
func Broadcast(b uint8) uint64 {
return broadcast(b)
}
func FirstMarkedByteIndex(w uint64) int {
return firstMarkedByteIndex(w)
}
func MarkZeroBytes(w uint64) uint64 {
return markZeroBytes(w)
}
func SetByte(w uint64, b uint8, idx int) uint64 {
return setByte(w, b, idx)
}
func NextPowOf2(v uint32) uint32 {
return nextPowOf2(v)
}
func MakeSeed() uint64 {
return makeSeed()
}
func HashString(s string, seed uint64) uint64 {
return hashString(s, seed)
}
func DefaultHasher[T comparable]() func(T, uint64) uint64 {
return defaultHasher[T]()
}