Handles are the better pointers
Not investment advice. Muhabbit scores how much a story may matter, not which way to trade.
A November 28, 2018 blog post by an experienced C/C++ developer argues that “index-handles” should replace raw and smart pointers for dynamic memory management in large codebases. Drawing on 15+ years of work on C++ projects of 0.5 to roughly 1 million lines of code, the author says smart-pointer-heavy “object spiderweb” designs cause cache misses, memory fragmentation and “fake leaks” that memory debugging tools cannot catch. The proposed approach centralizes memory management in systems such as rendering, physics and animation, groups same-type items into tightly packed arrays, and returns only index-handles to outside code rather than pointers. Handles use only as many bits as needed for the array index, with a per-slot generation counter added to prevent handle collisions. The author says the ideas are not new and fit data-oriented architectures better than classical OOP, and may also reduce garbage-collector pressure in higher-level languages.
Muhabbit's AI wrote this summary in its own words from Hacker News's report. It can get details wrong, so check the source.
Named in this story
C++, C