Centralized architectures such as rendering or physics engines take complete ownership of memory allocations by grouping similar items into tightly packed arrays. User-level code receives an index-handle instead of a direct memory reference, completely avoiding standard allocation routines. Unused bits inside these handles are cleverly repurposed to store per-slot generation counters that prevent collisions. When immediate data access is required, handles are briefly converted into short-lived pointers before central control resumes.
Key points
Confining direct memory manipulation to central systems significantly eases the debugging…: Confining direct memory manipulation to central systems significantly eases the debugging and performance optimization process.
The index-handle model delivers optimal results for applications that continually instant…: The index-handle model delivers optimal results for applications that continually instantiate and destroy hundreds to millions of objects.
Adopting this architecture requires developers to undertake substantial restructuring whe…: Adopting this architecture requires developers to undertake substantial restructuring when transitioning away from traditional object-oriented designs.
Sources checked by our analysis pipeline: 1
Handles are the better pointers
28-Nov-2018: I’ve added a small update at the end on how to prevent ‘handle collisions’ with a per-slot generation counter
Original Post:
…wherein I talk a bit about how I’m doing dynamic memory management in C and C++ these days which basically replaces raw- and smart-pointers with ‘index-handles’.
In my last blog post I was mentioning pointer- and allocation-free programming, but was skipping over the details. This is what the following blog post is about.
This is all based on the (sometimes painful) experience of wrestling for 15+ years with fairly big C++ code bases (0.5 to around 1 mloc) where memory is often managed through smart pointers. The worst case being tens- to hundreds-of-thousands of small C++ objects, each in its own heap allocation, pointing to each other through smart pointers. While such code is quite robust in terms of memory corruption (segfaults and corruption rarely happens, since most attempts are caught by asserts when dereferencing smart pointers), this type of ‘object spiderweb code’ is also dog-slow without obvious starting points for optimization, since…
Apple has released a new beta version of iOS that introduces artificial intelligence audio tools. The update also includes new features specifically tailored for China.
The watchOS 27.3 developer beta brings conversational recall tools directly to wearers' wrists by using continuous ambient listening to transcribe and summarize recent speech. Wearers can quickly retrieve missed dialogue or save auto-generated meeting notes within the Siri application. To alleviate surveillance fears, the company handles the continuous mic input entirely on isolated hardware without creating stored audio files.
The social platform is piloting a feature that inserts commercial promotions directly into search queries alongside organic results. Advertisers will target users based on contextual relevance, connecting specific product promotions to user search phrases. The rollout builds on an aggressive series of platform adjustments aimed at monetizing user activity and locking down internal data.