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

cmd/cgo: _cgoCheckPointer calling convention is suboptimal #18121

Closed
mdempsky opened this issue Nov 30, 2016 · 6 comments
Closed

cmd/cgo: _cgoCheckPointer calling convention is suboptimal #18121

mdempsky opened this issue Nov 30, 2016 · 6 comments

Comments

@mdempsky
Copy link
Member

_cgoCheckPointer is currently defined to take a ...interface{} parameter, but it always takes 0 or 1 arguments. And even in the 0 argument case, it would take less stack space to pass a nil interface{} value than a nil []interface{}.

Also, the []interface{} and the true argument used for pointers-to-fields currently escape to the heap. This could be addressed with the //go:noescape annotation.

/cc @ianlancetaylor

@mdempsky mdempsky added this to the Go1.9 milestone Nov 30, 2016
@bradfitz
Copy link
Contributor

For putting bools into interface values: #17725

@gopherbot
Copy link

CL https://golang.org/cl/35555 mentions this issue.

gopherbot pushed a commit that referenced this issue Feb 2, 2017
… allocation

Based in part on khr's CL 2500.

Updates #17725
Updates #18121

Change-Id: I744e1f92fc2104e6c5bd883a898c30b2eea8cc31
Reviewed-on: https://go-review.googlesource.com/35555
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
@ALTree ALTree modified the milestones: Go1.10, Go1.9 Jun 6, 2017
@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017
@gopherbot gopherbot modified the milestones: Go1.11, Unplanned May 23, 2018
@egonelbre
Copy link
Contributor

With https://go-review.googlesource.com/c/go/+/198081 it should be fixed, forgot to update the commit message.

@mdempsky
Copy link
Member Author

mdempsky commented Oct 2, 2019

@egonelbre Thanks. I didn't notice any //go:noescape changes in that CL. Does it turn out that's not needed?

@egonelbre
Copy link
Contributor

AFAIU it that was addressed in 0358367, however, I did not verify it.

@mdempsky
Copy link
Member Author

mdempsky commented Oct 2, 2019

@egonelbre Ah, right. I think this issue is fixed then. Thanks!

@mdempsky mdempsky closed this as completed Oct 2, 2019
@golang golang locked and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants