package maps
import "internal/runtime/maps"
Package maps implements Go's builtin map type.
Package maps implements Go's builtin map type.
Package maps implements Go's builtin map type.
Index ¶
- type Iter
- func (it *Iter) Elem() unsafe.Pointer
- func (it *Iter) Init(typ *abi.SwissMapType, m *Map)
- func (it *Iter) Initialized() bool
- func (it *Iter) Key() unsafe.Pointer
- func (it *Iter) Map() *Map
- func (it *Iter) Next()
- type Map
- func NewEmptyMap() *Map
- func NewMap(mt *abi.SwissMapType, hint uintptr, m *Map, maxAlloc uintptr) *Map
- func (m *Map) Clear(typ *abi.SwissMapType)
- func (m *Map) Delete(typ *abi.SwissMapType, key unsafe.Pointer)
- func (m *Map) Get(typ *abi.SwissMapType, key unsafe.Pointer) (unsafe.Pointer, bool)
- func (m *Map) Put(typ *abi.SwissMapType, key, elem unsafe.Pointer)
- func (m *Map) PutSlot(typ *abi.SwissMapType, key unsafe.Pointer) unsafe.Pointer
- func (m *Map) Used() uint64
Types ¶
type Iter ¶
type Iter struct {
// contains filtered or unexported fields
}
func (*Iter) Elem ¶
Key returns a pointer to the current element. nil indicates end of iteration.
Must not be called prior to Next.
func (*Iter) Init ¶
func (it *Iter) Init(typ *abi.SwissMapType, m *Map)
Init initializes Iter for iteration.
func (*Iter) Initialized ¶
func (*Iter) Key ¶
Key returns a pointer to the current key. nil indicates end of iteration.
Must not be called prior to Next.
func (*Iter) Map ¶
Map returns the map this iterator is iterating over.
func (*Iter) Next ¶
func (it *Iter) Next()
Next proceeds to the next element in iteration, which can be accessed via the Key and Elem methods.
The table can be mutated during iteration, though there is no guarantee that the mutations will be visible to the iteration.
Init must be called prior to Next.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func NewEmptyMap ¶
func NewEmptyMap() *Map
func NewMap ¶
If m is non-nil, it should be used rather than allocating.
maxAlloc should be runtime.maxAlloc.
TODO(prattmic): Put maxAlloc somewhere accessible.
func (*Map) Clear ¶
func (m *Map) Clear(typ *abi.SwissMapType)
Clear deletes all entries from the map resulting in an empty map.
func (*Map) Delete ¶
func (m *Map) Delete(typ *abi.SwissMapType, key unsafe.Pointer)
func (*Map) Get ¶
Get performs a lookup of the key that key points to. It returns a pointer to the element, or false if the key doesn't exist.
func (*Map) Put ¶
func (m *Map) Put(typ *abi.SwissMapType, key, elem unsafe.Pointer)
func (*Map) PutSlot ¶
PutSlot returns a pointer to the element slot where an inserted element should be written.
PutSlot never returns nil.
func (*Map) Used ¶
Source Files ¶
group.go map.go runtime.go runtime_noswiss.go table.go table_debug.go
- Version
- v1.24.1 (latest)
- Published
- Feb 27, 2025
- Platform
- windows/amd64
- Imports
- 5 packages
- Last checked
- 15 minutes ago –
Tools for package owners.