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

Use runtime.Pin to remove unsafe code #74

Open
jchv opened this issue Aug 18, 2024 · 0 comments
Open

Use runtime.Pin to remove unsafe code #74

jchv opened this issue Aug 18, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jchv
Copy link
Owner

jchv commented Aug 18, 2024

Time has passed and now it should be trivially possible to fix our broken reliance on pointers not moving, as runtime.Pin eventually did arrive in Go 1.21.

https://github.com/jchv/go-webview2/blob/master/pkg/edge/chromium.go#L49-L59

We probably just need one pinner for all of the handlers. One open question is when to execute the unpin; a finalizer might be the safest bet.

I'm considering this a bug since the code is relying on behavior that is explicitly not guaranteed.

@jchv jchv added bug Something isn't working good first issue Good for newcomers labels Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant