internal

package
v2.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastInt

func CastInt(v any) 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 IdentifyPanic added in v2.3.5

func IdentifyPanic(extraSkip int) string

IdentifyPanic reports the panic location when a panic happens.

func NextPowerOfTwo

func NextPowerOfTwo(x uint) uint

func UnpackSlice

func UnpackSlice(slice any) 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 *any) *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