Closed imyxh closed 12 months ago
The free functions are for mallocated memory - snd_pcm_hw_params_malloc
. The alloca variants use stack (see man alloca
for the storage, thus this space is freed automatically when the caller function exits).
Ah. That'll do it. I wasn't familiar with alloca
and assumed that _params_alloca
was just a funny way to say _params_malloc
. Thanks for explaining.
The following code segfaults on the call to
snd_pcm_hw_params_free
on my machine:The same goes for
s/hw/sw/g
. Am I doing something wrong? In more complex examples it seems to fail with munmap_chunk complaining about an invalid pointer, or free complaining about an invalid size.How are the
*_params_free
functions meant to be used?