Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

From: Brian Barrett (bbarrett_at_[hidden])
Date: 2007-07-24 10:41:27

On Jul 24, 2007, at 8:28 AM, Gleb Natapov wrote:

> On Tue, Jul 24, 2007 at 11:20:11AM -0300, Lisandro Dalcin wrote:
>> On 7/23/07, Jeff Squyres <jsquyres_at_[hidden]> wrote:
>>> Does anyone have any opinions on this? If not, I'll go implement
>>> option #1.
>> Sorry, Jeff... just reading this. I think your option #1 is the
>> better. However, I want to warn you about to issues:
>> * In my Linux FC6 box, malloc(0) return different pointers for each
>> call. In fact, I believe this is a requeriment for malloc, in the
>> case
> man malloc tells me this:
> "If size was equal to 0, either NULL or a pointer suitable to be
> passed to free()
> is returned". So may be we should just return NULL and be done with
> it?

Which is also what POSIX says:

I vote with gleb -- return NULL, don't set errno, and be done with
it. The way I read the advice to implementors, this would be a legal
response to a 0 byte request.