go_below_118.go 531 B

123456789101112131415161718192021
  1. //+build !go1.18
  2. package reflect2
  3. import (
  4. "unsafe"
  5. )
  6. // m escapes into the return value, but the caller of mapiterinit
  7. // doesn't let the return value escape.
  8. //go:noescape
  9. //go:linkname mapiterinit reflect.mapiterinit
  10. func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) (val *hiter)
  11. func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
  12. return &UnsafeMapIterator{
  13. hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)),
  14. pKeyRType: type2.pKeyRType,
  15. pElemRType: type2.pElemRType,
  16. }
  17. }