Search Results
6/14/2025, 4:34:02 PM
Being changing my programming language from automatic reference counting to something closer to manual memory management
I'm fine with the overhead of reference counting performance wise but it's unacceptable when dealing with multiple threads, changing the reference count needs to be atomic and all the optimizations that allow you remove some reference counts go out the window because another thread could be operating on an object at any time
So now I have unique_ref / shared_ref / manual_ref to handle ownership, and I use generational pointers under the hood to keep things memory safe so you can't deference deleted objects
I'm fine with the overhead of reference counting performance wise but it's unacceptable when dealing with multiple threads, changing the reference count needs to be atomic and all the optimizations that allow you remove some reference counts go out the window because another thread could be operating on an object at any time
So now I have unique_ref / shared_ref / manual_ref to handle ownership, and I use generational pointers under the hood to keep things memory safe so you can't deference deleted objects
Page 1