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.