Documentation
¶
Overview ¶
Package hashmap implements a simple non-blocking (lock-free) hash map.
The semantics of this hashmap are quite different from the go built-in. Aside from thread-safety, any values (including structs and slices) are allowed as keys, and a value of nil is indestinguishable from an element not being in the map.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hashmap ¶
type Hashmap struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Hashmap
Creates a hashmap with the default initial capacity (32). The hashmap will be grown to twice its size when the number of entries reaches 50% of the capacity.
func (*Hashmap) Del ¶
Deletes the given key from the map, and returns true if it existed. Although this method is semantically equivalent to m.Set(k, nil), this method will not allocate another key if the key is not already in use, and should therefore be used instead.