top | item 39075298

(no title)

tarnith | 2 years ago

Seen some audio engines that do this too. You can come up with an elegant non-blocking lock free allocator and pass updates from the user thread out to system and reserve the memory, or you can just up front allocate everything that's needed.

If it's a fixed function synth, sometimes just allocating everything up front makes more sense.

discuss

order

gabesk|2 years ago

Kernel drivers, too. Especially the DMA buffers for devices that don’t support scatter gather: if you don’t allocate them at driver startup, you might not be able to find enough free contiguous regions later. Although maybe that’s not as big of a deal these days, since both Windows and Linux can relocate physical pages.