We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using https://docs.julialang.org/en/v1.12-dev/devdocs/EscapeAnalysis/ it might be possible to avoid the explicit @lifetime scope and instead have lifetimes get inserted by the compiler automatically.
@lifetime
e.g.,
@do_magic function foo(x::Array, y) @own :mut x y @ref rx = x @own result = my_sum(rx) push!(x, result) end
You would want it to generate this:
function foo(x::Array, y) @own :mut x y lt1 = Lifetime() @ref ~lt1 rx = x @own result = my_sum(rx) cleanup!(lt1) push!(x, result) end
based on detecting that rx is last used at the line my_sum(rx). However, I'm not sure if EscapeAnalysis is smart enough to figure this out or not?
rx
my_sum(rx)
@MasonProtter interested in your thoughts.
If we figure this out, we could even allow for @ref x which could be really nice. Then it's basically the same as &x in Rust.
@ref x
&x
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using https://docs.julialang.org/en/v1.12-dev/devdocs/EscapeAnalysis/ it might be possible to avoid the explicit
@lifetime
scope and instead have lifetimes get inserted by the compiler automatically.e.g.,
You would want it to generate this:
based on detecting that
rx
is last used at the linemy_sum(rx)
. However, I'm not sure if EscapeAnalysis is smart enough to figure this out or not?@MasonProtter interested in your thoughts.
If we figure this out, we could even allow for
@ref x
which could be really nice. Then it's basically the same as&x
in Rust.The text was updated successfully, but these errors were encountered: