-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 ReferenceStorage
for manual allocation of references
#14106
Add ReferenceStorage
for manual allocation of references
#14106
Conversation
ReferenceStorage(T)
for manual allocation of T
ReferenceStorage
for manual allocation of references
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
As mentioned in the OP, naming is still kind of preliminary. But in absence of any really clever idea, we can just take ReferenceStorage
.
In case there is something inherently wrong about it, we can still change it as it's marked as experimental.
What about the minimal implementations for |
Not sure... Maybe we could leave them out for now and add them later if we notice they're missing? It's easy to patch them in ad-hoc, so this isn't holding up anything. I suppose instances of just_some_variable_to_put_this_on_the_stack = uninitialized ReferenceStorage(Foo)
foo = Foo.pre_initialize(pointerof(just_some_variable_to_put_this_on_the_stack)) And Probably, this pattern will be abstracted away in a macro for convenience, further reducing direct usage of |
The problem is |
Sounds good. Let's keep it then 👍 |
…rystal-lang#14106)" This reverts commit 15010d3.
This adds the
Instance
type mentioned in #13481. The naming is not final.