-
Notifications
You must be signed in to change notification settings - Fork 70
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
Automatically delete Obj
and related on drop
#144
base: master
Are you sure you want to change the base?
Conversation
Considering changing removal of functions to be behind a feature gate i.e. |
One other nice feature would be a solution (macro?) to support styles in
Flash not ram ....
…On Wed, Jun 21, 2023, 11:13 AM Nia ***@***.***> wrote:
Considering removal of functions to be behind a feature gate i.e.
static-obj-memory so that platforms where the overhead is "tolerated"
don't need to worry about all of this and can still make everything
'static. Alternatively, we can just have this done anyways with e.g. Box<T>::leak(mut
self) -> &'static mut T which is still in the code but commented out and
expose .leak() on T: NativeObject types. Would like to hear some opinions
—
Reply to this email directly, view it on GitHub
<#144 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPWAWV66JIC6QLJA5BXUYLXMMMTDANCNFSM6AAAAAAZOU6LTU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
How is this handled in C? |
With a variable declaration attribute
…On Wed, Jun 21, 2023, 11:17 AM Nia ***@***.***> wrote:
How is this handled in C?
—
Reply to this email directly, view it on GitHub
<#144 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPWAWVNN6DTV33LOF2FHSTXMMNAVANCNFSM6AAAAAAZOU6LTU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Alright. I'll open an issue for it when I get back to working on this |
See an example here: |
Working from this branch, I get
Not sure how this is supposed to work with code which isn't in the main() function or 'static scope |
This is "intended" and fixable but needs documentation. The issue is that theoretically let boxed_screen = Box::new(screen); // not &mut screen
boxed_screen.add_style(&mut style);
Assigning the style in a function that doesn't move that style into the same scope or greater than the object/screen it's assigned to is technically a use-after-free. You can get around this by leaking the style object (with |
Also note that this branch is WIP and will segfault if you do anything with it - tests pass, examples don't work though. I'm currently in the middle of a move so can't really work more until wednesday, sorry. |
No hurry, this is hobby space for me |
Yet more work towards #140, currently very broken and will require removing some quality-of-life functions i.e.
new()
.