freeipmi-devel
[Top][All Lists]
Advanced

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

Re: [llnl-devel] Re: [Freeipmi-devel] xmalloc


From: Anand Babu
Subject: Re: [llnl-devel] Re: [Freeipmi-devel] xmalloc
Date: Tue, 30 Dec 2003 15:59:51 -0800
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

,----[ Albert Chu <address@hidden> ]
| I just don't like the idea of a library outputting things to
| stdout/stderr all of a sudden (see fixup_null_alloc in xmalloc.c).
| 
| In addition, right now you don't check the return value within
| FreeIPMI when you call xmalloc(), so there are segfault possibilities.
`----
Running out of memory is an exceptional case. 
error () prints the message to stderr and calls exit ().

It is easier to troubleshoot if the app dies as soon as it runs out of
memory than causing some other failures at a later stage.

You will not get segfault, because xmalloc will call exit if it runs
out of memory. There is no need to check the return value of
xmalloc. Thats the sole purpose of xmalloc.

What do you think?

-- 
Anand Babu
Free as in Freedom <www.gnu.org>




reply via email to

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