unsafe

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2017 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes2Str

func Bytes2Str(b []byte) string

func IfcValuePtr

func IfcValuePtr(v interface{}) unsafe.Pointer

IfcValuePtr extracts the underlying values pointer from an empty interface{} value. Note: this might beome more unsafe in future go-versions, if primitive values < pointer size will be stored by value in the `interface{}` type.

func ReflValuePtr

func ReflValuePtr(v reflect.Value) unsafe.Pointer

ReflValuePtr extracts the pointer value from a reflect.Value instance. With reflect.Value basically being similar to `interface{}` augmented with additional flags to execute checks, we map the value into an empty interface value (no methods) and extract the actual values pointer. Note: this might beome more unsafe in future go-versions, if primitive values < pointer size will be stored by value in the `interface{}` type.

func Str2Bytes

func Str2Bytes(s string) []byte

func UnsafeFnPtr

func UnsafeFnPtr(fn interface{}) unsafe.Pointer

Returns a newly (allocated on heap) function pointer. The unsafe.Pointer returned can be used to cast a function type into a function with other(compatible) type (e.g. passing pointers only).

Types

This section is empty.

Jump to

Keyboard shortcuts

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