pointer

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 3 Imported by: 193 modules, 220 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.

README

go-pointer

Utility for cgo

Usage

https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md

In go 1.6, cgo argument can't be passed Go pointer.

var s string
C.pass_pointer(pointer.Save(&s))
v := *(pointer.Restore(C.get_from_pointer()).(*string))

Installation

go get github.com/mattn/go-pointer

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Restore

func Restore(ptr unsafe.Pointer) (v interface{})

func Save

func Save(v interface{}) unsafe.Pointer

func Unref

func Unref(ptr unsafe.Pointer)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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