Thing is: It doesn’t work. Alsa behaves very strange if I use it. Even if I make the m_params member public and access it directly. The only way it works is to not allocate from inside the class but outside like

snd_pcm_hw_params_alloca (&(hwparams.m_params));

snd_pcm_hw_params_alloca (&(hwparams.m_params));

Update: Seems replacing _alloca with _malloc fixes it.Update: Duh, that is because alloca allocates on stack and not on heap.