bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] too many FOO_exit_failure variables


From: Paul Eggert
Subject: Re: [Bug-gnulib] too many FOO_exit_failure variables
Date: 18 Jul 2003 09:59:57 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Bruno Haible <address@hidden> writes:

> How could this accomodate programs which consider xmalloc() failures
> fatal - there's no way to continue if memory is tight - but which
> want to gracefully recover from xmemcoll() failures?

Programs like that could call memcoll() instead of xmemcoll().
(There aren't any such programs, though.)

Here's another example.  I was thinking of adding an xstrcoll()
function, but it'd be overkill to give it a separate
xstrcoll_exit_failure variable, as it would exit like xmemcoll()
exits, and for the same reason.

> An alternative to such a global *_exit_failure variable per module is
> [except for 'xalloc'] to pass the desired error handling behaviour as an
> argument.

That behavior is less convenient for simple modules like xmemcoll and
xmalloc.  It is useful for modules where fine-grained control is
common and is hard to arrange by invoking the underyling module, but
it's not necessary for these modules.

The point here is one of convenience and ease of programming.  If
nobody really needs a fancier but-more-complicated feature, then we
should keep it simple.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]