Files
RetroArch/audio
libretroadmin d1cd1efeb6 microphone: allocate the staging buffers at first mic open
The six buffers the mic read pipeline flushes through - input,
converted, dual-mono, resampled, resampled-mono and final - were
allocated at driver init, which with microphone support enabled by
default meant 960 kilobytes of aligned heap on every session,
30 times max_frames across the six, paid whether or not any core
ever opened a microphone; a massif census of a headless run found
them sitting at peak. They now allocate on the first mic open,
verified idempotent against reopen and freed and nulled by the
existing deinit so a later open reallocates; the read path is only
reachable through an opened mic, so no consumer can see them null.
A second massif run confirms the startup attribution gone. The
driver context itself still initializes at startup and is the
remaining deferral candidate, left for a separate change.
2026-07-07 15:58:44 +02:00
..