github.com/primecitizens/pcz/std@v0.2.1/builtin/slice/types.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package stdslice
     5  
     6  import (
     7  	"unsafe"
     8  )
     9  
    10  type Header struct {
    11  	Array unsafe.Pointer
    12  	Len   int
    13  	Cap   int
    14  }
    15  
    16  // Split returns actual members of a slice.
    17  func Split[Elem any](s []Elem) (arr *Elem, sz, kap int) {
    18  	return unsafe.SliceData(s), len(s), cap(s)
    19  }