Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2001 20:02:26 -0500
From:      Alfred Perlstein <bright@sneakerz.org>
To:        Brian Somers <brian@Awfulhak.org>
Cc:        Assar Westerlund <assar@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libutil ecalloc.c emalloc.3 emalloc.c erealloc.c estrdup.c Makefile libutil.h
Message-ID:  <20010722200226.J49508@sneakerz.org>
In-Reply-To: <200107230058.f6N0wig12579@hak.lan.Awfulhak.org>; from brian@Awfulhak.org on Mon, Jul 23, 2001 at 01:58:44AM %2B0100
References:  <assar@FreeBSD.org> <200107230058.f6N0wig12579@hak.lan.Awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Brian Somers <brian@Awfulhak.org> [010722 19:58] wrote:
> > assar       2001/07/22 15:26:37 PDT
> > 
> >   Modified files:
> >     lib/libutil          Makefile libutil.h 
> >   Added files:
> >     lib/libutil          ecalloc.c emalloc.3 emalloc.c erealloc.c 
> >                          estrdup.c 
> >   Log:
> >   add ecalloc, emalloc, erealloc, estrdup - versions of the e-less
> >   functions that exit instead of failing
> >   
> >   Revision  Changes    Path
> >   1.43      +7 -3      src/lib/libutil/Makefile
> >   1.33      +5 -1      src/lib/libutil/libutil.h
> 
> What a bizarre idea.  IMHO this is not necessary.  Was this discussed 
> somewhere ?

I guess a lot of people use these type of functions, however I
really hate them because they give the programmer the illusion that
if memory fails it's ok to bail.  It is usually not as there may
be some external state such as tempfiles of locks to clean up.

IMO, better to tap NULL than to exit with your pants around your
ankles. :)

-- 
-Alfred Perlstein [alfred@freebsd.org]
Ok, who wrote this damn function called '??'?
And why do my programs keep crashing in it?

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010722200226.J49508>