You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
531 B
21 lines
531 B
//+build !go1.18
|
|
|
|
package reflect2
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
// m escapes into the return value, but the caller of mapiterinit
|
|
// doesn't let the return value escape.
|
|
//go:noescape
|
|
//go:linkname mapiterinit reflect.mapiterinit
|
|
func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) (val *hiter)
|
|
|
|
func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
|
|
return &UnsafeMapIterator{
|
|
hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)),
|
|
pKeyRType: type2.pKeyRType,
|
|
pElemRType: type2.pElemRType,
|
|
}
|
|
} |