Source File
map_swiss.go
Belonging Package
internal/abi
// Copyright 2023 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package abiimport ()// Map constants common to several packages// runtime/runtime-gdb.py:MapTypePrinter contains its own copyconst (// Number of bits in the group.slot count.SwissMapGroupSlotsBits = 3// Number of slots in a group.SwissMapGroupSlots = 1 << SwissMapGroupSlotsBits // 8// Maximum key or elem size to keep inline (instead of mallocing per element).// Must fit in a uint8.SwissMapMaxKeyBytes = 128SwissMapMaxElemBytes = 128ctrlEmpty = 0b10000000bitsetLSB = 0x0101010101010101// Value of control word with all empty slots.SwissMapCtrlEmpty = bitsetLSB * uint64(ctrlEmpty))type SwissMapType struct {TypeKey *TypeElem *TypeGroup *Type // internal type representing a slot group// function for hashing keys (ptr to key, seed) -> hashHasher func(unsafe.Pointer, uintptr) uintptrGroupSize uintptr // == Group.Size_SlotSize uintptr // size of key/elem slotElemOff uintptr // offset of elem in key/elem slotFlags uint32}// Flag valuesconst (SwissMapNeedKeyUpdate = 1 << iotaSwissMapHashMightPanicSwissMapIndirectKeySwissMapIndirectElem)func ( *SwissMapType) () bool { // true if we need to update key on an overwritereturn .Flags&SwissMapNeedKeyUpdate != 0}func ( *SwissMapType) () bool { // true if hash function might panicreturn .Flags&SwissMapHashMightPanic != 0}func ( *SwissMapType) () bool { // store ptr to key instead of key itselfreturn .Flags&SwissMapIndirectKey != 0}func ( *SwissMapType) () bool { // store ptr to elem instead of elem itselfreturn .Flags&SwissMapIndirectElem != 0}
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)