3 ms·
Most allocators are not constant time, and are fairly slow anyway. (Actually GC tend to have faster allocators, but obviously unpredictable pauses.) (Though t
by moonchild 6y ago
Most allocators are not constant time, and are fairly slow anyway. (Actually GC tend to have faster allocators, but obviously unpredictable pauses.)
(Though there was an allocator I saw recently that promised O(1) allocations. Pretty neat idea.)
- monocasa 6y agoCore game code commonly uses custom allocators that do provide those semantics though. A bump allocator that you reset every frame is O(1) and a dozen or so cycles per allocation for example.
- moonchild 6y agoSure, yes. I was referring more to ‘general-purpose dynamic allocator’ (malloc or so). I agree custom memory management/reclamation techniques can be fine for RT; just semantics.