Re: xmalloc string functions



Yevgen Muntyan wrote:
William Ahern wrote:

.... snip ...

To my mind, there's no difference in effort required to handle a
NULL return from fopen(), than a NULL return from malloc(). Maybe
more typing.

Then you are just really good. Because it's enormously more
typing. And more than that, it's more design questions too:
"what do I do in this situation, which I can't even possibly
test?" All this apart from real problems you have to solve.
Yes, *real*. No, g_malloc() aborting an application is not
a real problem. Not for a regular desktop application.

Oh? Do you detect a major difference in typing between:

ptr = xmalloc(sizeof *ptr);
and
if (!(ptr = malloc(sizeof *ptr))) fixit(sizeof *ptr);

and you can actually select the appropriate fixit function!!

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages