Skip to contentSkip to conversation

In alloc and free of snd_pcm_hw_params_t, segmentation happens

DISCUSSION Junji Umeno 2 participants 2 messages Sep 22, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

A simple question;
After an allocation with snd_pcm_hw_params_alloca, snd_pcm_hw_params_free stops by segmentation fault error. Is Alsa defferent from alloc and free coding structure?
Or I have any mistakes?
Segmentation error happens after set the params type to a pcm handler. The pcm handler holds it?

Yours,
Junji

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#1 lore raw
Quoted 2 lines · Junji Umeno

After an allocation with snd_pcm_hw_params_alloca, snd_pcm_hw_params_free stops by segmentation fault error.

There are two ways of allocating such structures:
1) Use snd_xxx_malloc() and snd_xxx_free() to allocate memory from the heap, or
2) use snd_xxx_alloca() to allocate memory from the stack.

The snd_xxx_alloca() functions behave just like alloca(): their memory is automatically freed when the function returns.

HTH
Clemens

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV