MCPcopy Create free account
hub / github.com/Super-long/ChubbyGo / NewConcurrentMap

Function NewConcurrentMap

BaseServer/concurrentHashMap.go:60–70  ·  view source on GitHub ↗

* * @brief: 创建一个新的map */

()

Source from the content-addressed store, hash-verified

58 * @brief: 创建一个新的map
59 */
60func NewConcurrentMap() *ConcurrentHashMap {
61 Map := ConcurrentHashMap{}
62 Map.ThreadSafeHashMap = make([]*ConcurrentMapShared, SHARD_COUNT)
63 for i := 0; i < SHARD_COUNT; i++ {
64 Map.ThreadSafeHashMap[i] = &ConcurrentMapShared{items: make(map[string]interface{})}
65 }
66 Map.NowKeyNumber = 0
67 Map.BucketNumber = uint32(SHARD_COUNT)
68
69 return &Map
70}
71
72/*
73 * @brief: 利用key得到哈希表内的桶

Callers 1

NewChubbyGoMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected