Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callback: use handles rather than passing Go pointers #268

Merged
merged 1 commit into from
Jan 31, 2016

Conversation

ianlancetaylor
Copy link
Contributor

The cgo pointer passing rules forbid passing a Go pointer to C if that
pointer points to memory containing other Go pointers. This is true
even if the Go pointer is converted to uintptr.

This change fixes the code to use a handle instead, and to look up the
handle in the callback function.

The cgo pointer passing rules forbid passing a Go pointer to C if that
pointer points to memory containing other Go pointers.  This is true
even if the Go pointer is converted to uintptr.

This change fixes the code to use a handle instead, and to look up the
handle in the callback function.
@mattn
Copy link
Owner

mattn commented Jan 31, 2016

Somehow, I had expected the patch. And also I just sure that the fixes against cgoCheckPointer will be large for another projects too. Thank you very much. And Sorry for taking your precious time.

mattn added a commit that referenced this pull request Jan 31, 2016
callback: use handles rather than passing Go pointers
@mattn mattn merged commit 57d9aeb into mattn:master Jan 31, 2016
vanadium-bot pushed a commit to vanadium-archive/third_party that referenced this pull request Mar 14, 2016
Motivation: To make things work with Go 1.6
Specifically to get this mattn/go-sqlite3#267
and mattn/go-sqlite3#268

Change-Id: I66daa419daebfddf1382ade56af4d1806eebf409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants