4 ms·
Dynamic allocations don't cause any issues with hard realtime, as long as you don't run out of memory.
by devit 6y ago
Dynamic allocations don't cause any issues with hard realtime, as long as you don't run out of memory.
- moonchild 6y agoMost 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.