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

Prevent heap escapes when calling Vulkan functions #192

Open
BrentFarris opened this issue Feb 15, 2024 · 0 comments
Open

Prevent heap escapes when calling Vulkan functions #192

BrentFarris opened this issue Feb 15, 2024 · 0 comments
Assignees

Comments

@BrentFarris
Copy link
Contributor

BrentFarris commented Feb 15, 2024

The proposal for noescape C functions has been accepted and will be in Go version 1.23. It was going to be in 1.22 but got pushed back, so we likely will see this com in another 6 months from now.

This will require updating the Vulkan package code to decorate the C calls with:

#cgo noescape <function name>

Currently, when calling into C from Go it assumes that all pointers provided to it must escape to the heap. For the Vulkan calls, this is not true as it typically is to pass an array with a count for a copy.

Note that using the Go pinner is not an option due to it's harsh performance overhead related to synchronizing with the GC (across threads).

@BrentFarris BrentFarris self-assigned this Feb 15, 2024
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

No branches or pull requests

1 participant