Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Clemens Ladisch" <cladisch@fastmail.net>
To: Junji Umeno <umeno@elwsc.co.jp>, alsa-devel@lists.sourceforge.net
Subject: Re: In alloc and free of snd_pcm_hw_params_t, segmentation   happens
Date: Fri, 22 Sep 2006 10:26:07 +0200	[thread overview]
Message-ID: <1158913567.12289.271560581@webmail.messagingengine.com> (raw)
In-Reply-To: <20060922144235.04e61757@localhost.localdomain>

Junji Umeno wrote:
> 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

      reply	other threads:[~2006-09-22  8:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-22  5:42 In alloc and free of snd_pcm_hw_params_t, segmentation happens Junji Umeno
2006-09-22  8:26 ` Clemens Ladisch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1158913567.12289.271560581@webmail.messagingengine.com \
    --to=cladisch@fastmail.net \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=umeno@elwsc.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox