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

Add unsafe flag #355

Closed
jenn-k-f opened this issue Aug 7, 2024 · 3 comments
Closed

Add unsafe flag #355

jenn-k-f opened this issue Aug 7, 2024 · 3 comments

Comments

@jenn-k-f
Copy link
Contributor

jenn-k-f commented Aug 7, 2024

Hello! I am currently using tinygo with msgp. However, tinygo version 0.31.0 started passing the flag purego which is causing the performance to take a hit, despite being okay with using the unsafe library.

I'd like to propose adding another flag into the msgp/unsafe.go and msgp/purego.go so that even if the purego flag is true, we can bypass and still use the unsafe library by setting another flag. Keeping the purego flag so that current uses aren't impacted.

ie) Change msgp/purego.go from:

//go:build purego || appengine
// +build purego appengine

to:

//go:build (purego && !unsafe) || appengine
// +build purego,!unsafe appengine

With a similar change in msgp/unsafe.go

Thanks!

@dgryski
Copy link

dgryski commented Aug 7, 2024

This issue (purego disabling unsafe instead of just assembly and cgo) was raised by one of the TinyGo developers at the time golang/go#23172 (comment) .

@klauspost
Copy link
Collaborator

It is of course clumsy, but pragmatically it seems reasonable, given that it is backwards compatible. Feel free to open a PR.

@klauspost
Copy link
Collaborator

Merged.

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

3 participants