-
-
Notifications
You must be signed in to change notification settings - Fork 758
Garbage Collection of nil
Pointers
#888
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
Comments
Until the garbage collector is implemented, we may need to add |
That is a very good point for a transition period. Whilst the garbage collector for |
Also, in the interim, just like the Odin parser infers semicolons, we could have |
I don't quite understand the idea. |
This is the only thing that’s keeping me from using Odin in production. Why do I have to write |
Can’t we have borrowed nil pointers as well? It would help making nil thread safe, as well as enabling more modern memory features in Odin. |
@lerno That would have to be a much later edition. Borrow checking would have to be implemented after this feature. But it does enable more modern memory management approach in Odin. |
And obviously, most importantly, for maximal type and memory safety i suggest that you require every memory operation to be wrapped in unsafe blocks.Otherwise it is indistinguishable from programmer's perspective what is safe and what is harmful. |
I think @atkurtul raises an important point. Also, since every operation could possibly fail due to processor or memory malfunction, maybe each operation, including arithmetics, could also return an error value that you are forced to check before continuing to the next computation? |
also, you may consider to change the keyword and value of |
Could we have a type specifically for nil pointers? Maybe with dependant types |
|
Although all of these proposals are awesome, let's postpone them until next April 1st. |
This was an April Fool's Joke. |
Is your feature request related to a problem? Please describe.
Implement a garbage collector as part of the Odin runtime which will free
nil
pointers to minimize memory usage.Describe the solution you'd like
Anytime a pointer is
nil
and has no more usage within the program, the garbage collector can free these specific pointers.Note: only
nil
pointers will be garbage collected; no other pointers.The text was updated successfully, but these errors were encountered: