mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
internal/unsafe: get rid of SliceOf
Move SliceOf to the package of the only user and unexport it. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -31,16 +31,3 @@ func BytesView(s interface{}) []byte {
|
||||
h.Len = v.Len() * sz
|
||||
return res
|
||||
}
|
||||
|
||||
// SliceOf returns a slice from a (native) pointer.
|
||||
func SliceOf(s uintptr) []byte {
|
||||
if s == 0 {
|
||||
return nil
|
||||
}
|
||||
var res []byte
|
||||
h := (*reflect.SliceHeader)(unsafe.Pointer(&res))
|
||||
h.Data = s
|
||||
h.Cap = 1 << 30
|
||||
h.Len = 1 << 30
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user