github.com/wI2L/jettison@v0.7.5-0.20230106001914-c70014c6417a/map_1.18.go (about)

     1  //go:build go1.18
     2  
     3  package jettison
     4  
     5  import "unsafe"
     6  
     7  func newHiter(t, m unsafe.Pointer) *hiter {
     8  	v := hiterPool.Get()
     9  	if v == nil {
    10  		var it hiter
    11  		newmapiter(t, m, &it)
    12  		return &it
    13  	}
    14  	it := v.(*hiter)
    15  	*it = *zeroHiter
    16  	mapiterinit(t, m, unsafe.Pointer(it))
    17  	return it
    18  }
    19  
    20  //go:noescape
    21  //go:linkname newmapiter reflect.mapiterinit
    22  func newmapiter(unsafe.Pointer, unsafe.Pointer, *hiter)