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

compiler: mark stringFromBytes as nocapture/readonly to help escape a… #4534

Conversation

dgryski
Copy link
Member

@dgryski dgryski commented Oct 18, 2024

…nalysis

Fixes #4525

@dgryski
Copy link
Member Author

dgryski commented Oct 18, 2024

I have some time at airports today; I might look at some of the other strconv escape analysis issues and see if there's anything else there with an easy fix.

@aykevl
Copy link
Member

aykevl commented Oct 18, 2024

Would it be possible to add a test to transform/testdata/allocs2.go?

@dgryski
Copy link
Member Author

dgryski commented Oct 18, 2024

Added.

New test fails on dev with

        allocs2.go:53: object allocated on the heap: escapes at line 54

and passes on this branch.

@dgryski dgryski force-pushed the dgryski/string-from-bytes-nocapture-readonly branch from 8678fa5 to 52662c4 Compare October 18, 2024 21:11
@deadprogram
Copy link
Member

OK this is great, I quite need this actually. Thank you very much @dgryski and to @aykevl for review.

Now merging.

@deadprogram deadprogram merged commit 951e50c into tinygo-org:dev Oct 19, 2024
17 checks passed
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.

3 participants