by deagle50 · 1y ago · 0 comments
In Jai/Odin, every scope has default global and temp allocators, there's nothing stopping you from transferring ownership and/or passing pointers down the callstack. Then you either free in the last scope where the pointer lives or you pick a natural lifetime near the top of the callstack, defer clear temp there, and forget about it.
Or you leak the resource.
How so? RAII absolutely doesn't imply reference counting.