stdmap

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make(t *abi.MapType, hint int, h *hmap) *hmap

func MakeSmall

func MakeSmall() *hmap

func MapAccess1

func MapAccess1(t *abi.MapType, h *hmap, key unsafe.Pointer) unsafe.Pointer

func MapAccess1Fast32

func MapAccess1Fast32(t *abi.MapType, h *hmap, key uint32) unsafe.Pointer

func MapAccess1Fast64

func MapAccess1Fast64(t *abi.MapType, h *hmap, key uint64) unsafe.Pointer

func MapAccess1FastString

func MapAccess1FastString(t *abi.MapType, h *hmap, key string) unsafe.Pointer

func MapAccess1Fat

func MapAccess1Fat(t *abi.MapType, h *hmap, key unsafe.Pointer, zero *abi.Type) unsafe.Pointer

func MapAccess2

func MapAccess2(t *abi.MapType, h *hmap, key unsafe.Pointer) (unsafe.Pointer, bool)

func MapAccess2Fast32

func MapAccess2Fast32(t *abi.MapType, h *hmap, key uint32) (unsafe.Pointer, bool)

func MapAccess2Fast64

func MapAccess2Fast64(t *abi.MapType, h *hmap, key uint64) (unsafe.Pointer, bool)

func MapAccess2FastString

func MapAccess2FastString(t *abi.MapType, h *hmap, key string) (unsafe.Pointer, bool)

func MapAccess2Fat

func MapAccess2Fat(t *abi.MapType, h *hmap, key unsafe.Pointer, zero *abi.Type) (unsafe.Pointer, bool)

func MapAssign

func MapAssign(t *abi.MapType, h *hmap, key unsafe.Pointer) unsafe.Pointer

func MapAssignFast32

func MapAssignFast32(t *abi.MapType, h *hmap, key uint32) unsafe.Pointer

func MapAssignFast32Ptr

func MapAssignFast32Ptr(t *abi.MapType, h *hmap, key unsafe.Pointer) unsafe.Pointer

func MapAssignFast64

func MapAssignFast64(t *abi.MapType, h *hmap, key uint64) unsafe.Pointer

func MapAssignFast64Ptr

func MapAssignFast64Ptr(t *abi.MapType, h *hmap, key unsafe.Pointer) unsafe.Pointer

func MapAssignFastString

func MapAssignFastString(t *abi.MapType, h *hmap, key string) unsafe.Pointer

func MapClear

func MapClear(t *abi.MapType, h *hmap)

func MapDelete

func MapDelete(t *abi.MapType, h *hmap, key unsafe.Pointer)

func MapDeleteFast32

func MapDeleteFast32(t *abi.MapType, h *hmap, key uint32)

func MapDeleteFast64

func MapDeleteFast64(t *abi.MapType, h *hmap, key uint64)

func MapDeleteFastString

func MapDeleteFastString(t *abi.MapType, h *hmap, key string)

func MapIterInit

func MapIterInit(t *abi.MapType, h *hmap, it *hiter)

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`.

type MapBucket

type MapBucket struct {
	// contains filtered or unexported fields
}

A bucket for a Go map.

type MapExtra

type MapExtra struct {
	// contains filtered or unexported fields
}

MapExtra holds fields that are not present on all maps.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL