github.com/trim21/go-phpserialize@v0.0.22-0.20240301204449-2fca0319b3f0/internal/runtime/map.go (about)

     1  package runtime
     2  
     3  import "unsafe"
     4  
     5  type HashIter struct {
     6  	_ unsafe.Pointer // key
     7  	_ unsafe.Pointer // elem
     8  	_ unsafe.Pointer // t
     9  	_ unsafe.Pointer // h
    10  	_ unsafe.Pointer // buckets
    11  	_ unsafe.Pointer // bptr
    12  	_ unsafe.Pointer // overflow
    13  	_ unsafe.Pointer // oldoverflow
    14  	_ uintptr        // startBucket
    15  	_ uint8          // offset
    16  	_ bool           // wrapped
    17  	_ uint8          // B
    18  	_ uint8          // i
    19  	_ uintptr        // bucket
    20  	_ uintptr        // checkBucket
    21  }
    22  
    23  // new
    24  
    25  //go:linkname MakeMap reflect.makemap
    26  func MakeMap(*Type, int) unsafe.Pointer
    27  
    28  // write
    29  
    30  //go:linkname MapAssignFastStr runtime.mapassign_faststr
    31  //go:noescape
    32  func MapAssignFastStr(t *Type, m unsafe.Pointer, s string) unsafe.Pointer
    33  
    34  //go:linkname MapAssign reflect.mapassign
    35  //go:noescape
    36  func MapAssign(t *Type, m unsafe.Pointer, k, v unsafe.Pointer)
    37  
    38  // read
    39  
    40  //go:linkname MapLen reflect.maplen
    41  //go:noescape
    42  func MapLen(m unsafe.Pointer) int
    43  
    44  //go:linkname MapIterInit runtime.mapiterinit
    45  //go:noescape
    46  func MapIterInit(mapType *Type, m unsafe.Pointer, it *HashIter)
    47  
    48  //go:linkname MapIterNext reflect.mapiternext
    49  //go:noescape
    50  func MapIterNext(it *HashIter)
    51  
    52  //go:linkname MapIterValue reflect.mapiterelem
    53  func MapIterValue(it *HashIter) uintptr
    54  
    55  //go:linkname MapIterKey reflect.mapiterkey
    56  //go:noescape
    57  func MapIterKey(it *HashIter) uintptr