[Top][All Lists]

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

Re: [Freeipmi-devel] xmalloc

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

Purpose of xmalloc is to check the return value of malloc. C does not
have any exception handling facility. Code for error handling can grow
more than the actual code if all return values are checked.

When the library does not have enough memory to complete the operation
successfully, what should it do.

We can write a local XMALLOC which sets ENOMEM and calls return  or
exit with failure.

I will make the release of lan-fiid today. 


,----[ Albert Chu <address@hidden> ]
| Hey AB,
| I just noticed.  A message will fprintf to stderr when the system runs
| out of memory.  I don't think we want this for a library.  Shouldn't
| we return errno = ENOMEM??

Free as in Freedom <>

reply via email to

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