Handles Are the Better Pointers

The author discusses the challenges of memory management in C and C++, particularly in large codebases where memory is often managed through smart pointers. To tackle these issues, the author proposes the use of index-handles, which replace pointers to reduce memory corruption and optimize cache use. They suggest moving memory management into centralized systems, grouping items of the same type into arrays, and using public index-handles instead of pointers. The author highlights the usefulness of handles for shared object identifiers and reserving handle bits for item types. They also suggest using a generation counter to prevent handle collisions.

https://floooh.github.io/2018/06/17/handles-vs-pointers.html

To top