github.com/fufuok/utils@v1.0.10/xsync/export_mapof_test.go (about)

     1  //go:build go1.18
     2  // +build go1.18
     3  
     4  package xsync
     5  
     6  type (
     7  	BucketOfPadded = bucketOfPadded
     8  )
     9  
    10  func MakeHasher[T comparable]() func(T, uint64) uint64 {
    11  	return makeHasher[T]()
    12  }
    13  
    14  func CollectMapOfStats[K comparable, V any](m *MapOf[K, V]) MapStats {
    15  	return MapStats{m.stats()}
    16  }
    17  
    18  func NewMapOfPresizedWithHasher[K comparable, V any](
    19  	hasher func(K, uint64) uint64,
    20  	sizeHint int,
    21  ) *MapOf[K, V] {
    22  	return newMapOfPresized[K, V](hasher, sizeHint)
    23  }