const loadFactorNum … const loadFactorDen … type maptype … var maps_errNilAssign … //go:linkname maps_mapKeyError internal/runtime/maps.mapKeyError func maps_mapKeyError(t *abi.SwissMapType, p unsafe.Pointer) error { … } func makemap64(t *abi.SwissMapType, hint int64, m *maps.Map) *maps.Map { … } // makemap_small implements Go map creation for make(map[k]v) and // make(map[k]v, hint) when hint is known to be at most abi.SwissMapGroupSlots // at compile time and the map needs to be allocated on the heap. func makemap_small() *maps.Map { … } // makemap implements Go map creation for make(map[k]v, hint). // If the compiler has determined that the map or the first group // can be created on the stack, m and optionally m.dirPtr may be non-nil. // If m != nil, the map can be created directly in m. // If m.dirPtr != nil, it points to a group usable for a small map. func makemap(t *abi.SwissMapType, hint int, m *maps.Map) *maps.Map { … } // mapaccess1 returns a pointer to h[key]. Never returns nil, instead // it will return a reference to the zero object for the elem type if // the key is not in the map. // NOTE: The returned pointer may keep the whole map live, so don't // hold onto it for very long. // // mapaccess1 is pushed from internal/runtime/maps. We could just call it, but // we want to avoid one layer of call. // //go:linkname mapaccess1 func mapaccess1(t *abi.SwissMapType, m *maps.Map, key unsafe.Pointer) unsafe.Pointer func mapaccess2(t *abi.SwissMapType, m *maps.Map, key unsafe.Pointer) (unsafe.Pointer, bool) func mapaccess1_fat(t *abi.SwissMapType, m *maps.Map, key, zero unsafe.Pointer) unsafe.Pointer { … } func mapaccess2_fat(t *abi.SwissMapType, m *maps.Map, key, zero unsafe.Pointer) (unsafe.Pointer, bool) { … } // mapassign is pushed from internal/runtime/maps. We could just call it, but // we want to avoid one layer of call. // //go:linkname mapassign func mapassign(t *abi.SwissMapType, m *maps.Map, key unsafe.Pointer) unsafe.Pointer func mapdelete(t *abi.SwissMapType, m *maps.Map, key unsafe.Pointer) { … } // mapiterinit initializes the Iter struct used for ranging over maps. // The Iter struct pointed to by 'it' is allocated on the stack // by the compilers order pass or on the heap by reflect_mapiterinit. // Both need to have zeroed hiter since the struct contains pointers. func mapiterinit(t *abi.SwissMapType, m *maps.Map, it *maps.Iter) { … } func mapiternext(it *maps.Iter) { … } // mapclear deletes all keys from a map. func mapclear(t *abi.SwissMapType, m *maps.Map) { … } //go:linkname reflect_makemap reflect.makemap func reflect_makemap(t *abi.SwissMapType, cap int) *maps.Map { … } //go:linkname reflect_mapaccess reflect.mapaccess func reflect_mapaccess(t *abi.SwissMapType, m *maps.Map, key unsafe.Pointer) unsafe.Pointer { … } //go:linkname reflect_mapaccess_faststr reflect.mapaccess_faststr func reflect_mapaccess_faststr(t *abi.SwissMapType, m *maps.Map, key string) unsafe.Pointer { … } //go:linkname reflect_mapassign reflect.mapassign0 func reflect_mapassign(t *abi.SwissMapType, m *maps.Map, key unsafe.Pointer, elem unsafe.Pointer) { … } //go:linkname reflect_mapassign_faststr reflect.mapassign_faststr0 func reflect_mapassign_faststr(t *abi.SwissMapType, m *maps.Map, key string, elem unsafe.Pointer) { … } //go:linkname reflect_mapdelete reflect.mapdelete func reflect_mapdelete(t *abi.SwissMapType, m *maps.Map, key unsafe.Pointer) { … } //go:linkname reflect_mapdelete_faststr reflect.mapdelete_faststr func reflect_mapdelete_faststr(t *abi.SwissMapType, m *maps.Map, key string) { … } //go:linkname reflect_mapiterinit reflect.mapiterinit func reflect_mapiterinit(t *abi.SwissMapType, m *maps.Map, it *maps.Iter) { … } //go:linkname reflect_mapiternext reflect.mapiternext func reflect_mapiternext(it *maps.Iter) { … } //go:linkname reflect_mapiterkey reflect.mapiterkey func reflect_mapiterkey(it *maps.Iter) unsafe.Pointer { … } //go:linkname reflect_mapiterelem reflect.mapiterelem func reflect_mapiterelem(it *maps.Iter) unsafe.Pointer { … } //go:linkname reflect_maplen reflect.maplen func reflect_maplen(m *maps.Map) int { … } //go:linkname reflect_mapclear reflect.mapclear func reflect_mapclear(t *abi.SwissMapType, m *maps.Map) { … } //go:linkname reflectlite_maplen internal/reflectlite.maplen func reflectlite_maplen(m *maps.Map) int { … } // mapinitnoop is a no-op function known the Go linker; if a given global // map (of the right size) is determined to be dead, the linker will // rewrite the relocation (from the package init func) from the outlined // map init function to this symbol. Defined in assembly so as to avoid // complications with instrumentation (coverage, etc). func mapinitnoop() // mapclone for implementing maps.Clone // //go:linkname mapclone maps.clone func mapclone(m any) any { … } func mapclone2(t *abi.SwissMapType, src *maps.Map) *maps.Map { … } // keys for implementing maps.keys // //go:linkname keys maps.keys func keys(m any, p unsafe.Pointer) { … } // values for implementing maps.values // //go:linkname values maps.values func values(m any, p unsafe.Pointer) { … }