News for hackers. Stuff that matters.
Re:When the memory allocator works against you by Kenji on Sunday March 12, 2017 @04:48PM (#13853007)
Actually, to address realtime constraints... In my job, I work on systems with realtime constraints and even in less critical parts (latency of ~100 microseconds is still acceptable) we had to eliminate all malloc calls. Mostly because malloc on our platform essentially acquires one big lock for memory operations and if some other process has that lock, you get nasty delays or even priority inversions. Allocate a big chunk beforehand, preferrably in the form of ring buffers, and then operate on these if you need precise timing and performance.
Re:When the memory allocator works against you by jstimpfle on Sunday March 12, 2017 @05:11PM (#13853154)
... or use a version of malloc on that preallocated thread-local chunk. At least if the only problem is locking overhead.