github.com/primecitizens/pcz/std@v0.2.1/builtin/map/iter.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  //
     4  // Copyright 2014 The Go Authors. All rights reserved.
     5  // Use of this source code is governed by a BSD-style
     6  // license that can be found in the LICENSE file.
     7  
     8  package stdmap
     9  
    10  import (
    11  	"unsafe"
    12  
    13  	"github.com/primecitizens/pcz/std/core/abi"
    14  )
    15  
    16  // A hash iteration structure.
    17  // If you modify HashIter, also change cmd/compile/internal/reflectdata/reflect.go
    18  // and reflect/value.go to match the layout of this structure.
    19  type HashIter struct {
    20  	Key         unsafe.Pointer // Must be in first position.  Write nil to indicate iteration end (see cmd/compile/internal/walk/range.go).
    21  	Elem        unsafe.Pointer // Must be in second position (see cmd/compile/internal/walk/range.go).
    22  	T           *abi.MapType
    23  	H           *hmap
    24  	Buckets     unsafe.Pointer // bucket ptr at hash_iter initialization time
    25  	Bptr        *bmap          // current bucket
    26  	Overflow    *[]*bmap       // keeps overflow buckets of hmap.buckets alive
    27  	OldOverflow *[]*bmap       // keeps overflow buckets of hmap.oldbuckets alive
    28  	StartBucket uintptr        // bucket iteration started at
    29  	Offset      uint8          // intra-bucket offset to start from during iteration (should be big enough to hold bucketCnt-1)
    30  	Wrapped     bool           // already wrapped around from end of bucket array to beginning
    31  	B           uint8
    32  	I           uint8
    33  	Bucket      uintptr
    34  	CheckBucket uintptr
    35  }
    36  
    37  func MapIterInit(t *abi.MapType, h *hmap, it *hiter) {}
    38  
    39  func MapIterNext(it *hiter) {}