Jonathan Adams wrote:
> On Wed, Feb 18, 2009 at 07:42:29PM +0100, Roland Mainz wrote:
> > 3. |libc::malloc()| cannot be used in signal handlers while the AST
> > version allows this
> 
> How does it allow this?

Basically (ignoring the case of multiple threads in the following
example): You set a static variable which remebers when you entered
|malloc()| (and clear it when you leave the function). If you enter
|malloc()| and the variable is already set then you're likely hitting
the case of a |malloc()| call interupted by a signal handler (note that
this may be nested infinitly (for example if someone bombs a process
with various signals)).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to