[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: Small patch to aid use of lib dmalloc
On Tue, 2010-12-07 at 00:48 +0000, Peter Clifton wrote:
> On Tue, 2010-12-07 at 10:04 +1100, Stephen Ecob wrote:
>
> > Dropping the (a) ? (a) : 1 foolishness would be cleaner, but could
> > expose latent bugs in the 71 callers of the mymem allocators.
> > I'm happy to proceed either way. What is your preference ?
>
> Let me push a big patch nuking the My* allocation functions, that would
> make me feel much happier.
Damnit, MyMalloc does some other "helpful" things, like checking for a
memory allocation failure and aborting with a useful diagnostic message.
I'd be pretty happy to drop the messages (as it is not such a common
occurrence), but I do note that the changes I'm about to propose will
change a known handled failure path with a nice error message and
termination, to retuning a NULL pointer which is then probably used,
"probably" followed by segfault.
On Linux at least, "malloc" will tend to always succeed rather than
returning out of memory.
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user