Subject: Re: Libification project (SoC)

From: Johannes Sixt <[email-masked]>
Date: Fri, 16 Mar 2007 09:06:51 +0100

"Shawn O. Pearce" wrote:
> "Luiz Fernando N. Capitulino" <[email-masked]> wrote:
> >     o Avoid dying when a function call fails (eg, malloc())
> 
> malloc is a huge problem in the Git code today.  Almost all
> of our malloc calls are actually through the xmalloc wrapper.
> All xmalloc callers assume xmalloc will *never* fail.  This
> makes it, uh, interesting.  ;-)

You could think about longjmp(3)ing out into main(), which would have to
setjmp(3). But in order to clean up intermediate frames, you would have
to have a stack of setjmp/longjmp buffers.

Oh, well, how do I *love* them C++ exceptions!

-- Hannes