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

optimize locals to the stack #131

Open
disruptek opened this issue May 28, 2021 · 1 comment
Open

optimize locals to the stack #131

disruptek opened this issue May 28, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@disruptek
Copy link
Contributor

When locals aren't used in remote legs, we don't need to move them to the environment.

@disruptek disruptek added the enhancement New feature or request label May 28, 2021
@alaviss
Copy link
Contributor

alaviss commented Jun 14, 2021

This one is particularly hard, consider:

proc foo() =
  var s = "string"
  var c = cstring(s)
  noop()
  echo $c

Despite only c is used in the following continuation, we must keep s because c leases s resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants