[linux-audio-dev] malloc() in RT code considered not-so-harmful?

Tim Hockin thockin at hockin.org
Tue Jul 13 17:59:39 UTC 2004


On Tue, Jul 13, 2004 at 10:21:23AM -0700, Joshua Haberman wrote:
> You could use a lock-free malloc as an emergency memory store for when 
> your pre-allocated buffers run out.

There's no such thing as a lock free malloc() that calls brk(), unless I
am confused.  brk() is a syscall that can block the caller.

To make a lock-free malloc(), you have to malloc() a big chunk of memory,
then run your own allocator against it.  You don't reduce your overhead at
all.

Or am I confused?  Allocators never were my focus.. :)



More information about the Linux-audio-dev mailing list