internal

package
v2.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastInt

func CastInt(v interface{}) int64

CastInt returns an integer v's value as int64. v must be an integer, else it panics.

func CastIntPointer

func CastIntPointer(kind reflect.Kind, ptr unsafe.Pointer) int64

CastIntPointer returns ptr's value as int64, the underlying value is cast to int64 using unsafe tricks according kind.

If ptr is not pointed to an integer or kind does not match ptr, the behavior is undefined, it may panic or return incorrect value.

func NextPowerOfTwo

func NextPowerOfTwo(x uint) uint

func UnpackSlice

func UnpackSlice(slice interface{}) unsafeheader.Slice

UnpackSlice unpacks the given slice interface{} to unsafeheader.Slice.

Types

type EmptyInterface

type EmptyInterface struct {
	RType unsafe.Pointer // *rtype
	Word  unsafe.Pointer
}

EmptyInterface is the header for an interface{} value. It's a copy type of runtime.eface.

func EFaceOf

func EFaceOf(ep *interface{}) *EmptyInterface

EFaceOf casts the empty interface{} pointer to an EmptyInterface pointer.

Directories

Path Synopsis
Package constraints defines a set of useful constraints to be used with type parameters.
Package constraints defines a set of useful constraints to be used with type parameters.
Package unsafeheader contains header declarations for the Go runtime's slice and string implementations.
Package unsafeheader contains header declarations for the Go runtime's slice and string implementations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL