Documentation
¶
Index ¶
- func Make(t *abi.MapType, hint int, h *hmap) *hmap
- func MakeSmall() *hmap
- func MapAccess1(t *abi.MapType, h *hmap, key unsafe.Pointer) unsafe.Pointer
- func MapAccess1Fast32(t *abi.MapType, h *hmap, key uint32) unsafe.Pointer
- func MapAccess1Fast64(t *abi.MapType, h *hmap, key uint64) unsafe.Pointer
- func MapAccess1FastString(t *abi.MapType, h *hmap, key string) unsafe.Pointer
- func MapAccess1Fat(t *abi.MapType, h *hmap, key unsafe.Pointer, zero *abi.Type) unsafe.Pointer
- func MapAccess2(t *abi.MapType, h *hmap, key unsafe.Pointer) (unsafe.Pointer, bool)
- func MapAccess2Fast32(t *abi.MapType, h *hmap, key uint32) (unsafe.Pointer, bool)
- func MapAccess2Fast64(t *abi.MapType, h *hmap, key uint64) (unsafe.Pointer, bool)
- func MapAccess2FastString(t *abi.MapType, h *hmap, key string) (unsafe.Pointer, bool)
- func MapAccess2Fat(t *abi.MapType, h *hmap, key unsafe.Pointer, zero *abi.Type) (unsafe.Pointer, bool)
- func MapAssign(t *abi.MapType, h *hmap, key unsafe.Pointer) unsafe.Pointer
- func MapAssignFast32(t *abi.MapType, h *hmap, key uint32) unsafe.Pointer
- func MapAssignFast32Ptr(t *abi.MapType, h *hmap, key unsafe.Pointer) unsafe.Pointer
- func MapAssignFast64(t *abi.MapType, h *hmap, key uint64) unsafe.Pointer
- func MapAssignFast64Ptr(t *abi.MapType, h *hmap, key unsafe.Pointer) unsafe.Pointer
- func MapAssignFastString(t *abi.MapType, h *hmap, key string) unsafe.Pointer
- func MapClear(t *abi.MapType, h *hmap)
- func MapDelete(t *abi.MapType, h *hmap, key unsafe.Pointer)
- func MapDeleteFast32(t *abi.MapType, h *hmap, key uint32)
- func MapDeleteFast64(t *abi.MapType, h *hmap, key uint64)
- func MapDeleteFastString(t *abi.MapType, h *hmap, key string)
- func MapIterInit(t *abi.MapType, h *hmap, it *hiter)
- func MapIterNext(it *hiter)
- type HashIter
- type HashMap
- type MapBucket
- type MapExtra
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapAccess1FastString ¶
func MapAccess1Fat ¶
func MapAccess2 ¶
func MapAccess2Fast32 ¶
func MapAccess2Fast64 ¶
func MapAccess2FastString ¶
func MapAccess2Fat ¶
func MapAssignFast32Ptr ¶
func MapAssignFast64Ptr ¶
func MapAssignFastString ¶
func MapDeleteFast32 ¶
func MapDeleteFast64 ¶
func MapDeleteFastString ¶
func MapIterInit ¶
func MapIterNext ¶
func MapIterNext(it *hiter)
Types ¶
type HashIter ¶
type HashIter struct {
Key unsafe.Pointer // Must be in first position. Write nil to indicate iteration end (see cmd/compile/internal/walk/range.go).
Elem unsafe.Pointer // Must be in second position (see cmd/compile/internal/walk/range.go).
T *abi.MapType
H *hmap
Buckets unsafe.Pointer // bucket ptr at hash_iter initialization time
Bptr *bmap // current bucket
Overflow *[]*bmap // keeps overflow buckets of hmap.buckets alive
OldOverflow *[]*bmap // keeps overflow buckets of hmap.oldbuckets alive
StartBucket uintptr // bucket iteration started at
Offset uint8 // intra-bucket offset to start from during iteration (should be big enough to hold bucketCnt-1)
Wrapped bool // already wrapped around from end of bucket array to beginning
B uint8
I uint8
Bucket uintptr
CheckBucket uintptr
}
A hash iteration structure. If you modify HashIter, also change cmd/compile/internal/reflectdata/reflect.go and reflect/value.go to match the layout of this structure.
type HashMap ¶
type HashMap struct {
// Note: the format of the hmap is also encoded in cmd/compile/internal/reflectdata/reflect.go.
// Make sure this stays in sync with the compiler's definition.
Count int // # live cells == size of map. Must be first (used by len() builtin)
Flags uint8
B uint8 // log_2 of # of buckets (can hold up to loadFactor * 2^B items)
Noverflow uint16 // approximate number of overflow buckets; see incrnoverflow for details
Hash0 uint32 // hash seed
Nevacuate uintptr // progress counter for evacuation (buckets less than this have been evacuated)
Extra *mapextra // optional fields
// contains filtered or unexported fields
}
A HashMap is the standard implementation of Go `map`.
Click to show internal directories.
Click to hide internal directories.