[MOAB-dev] [Itaps-users] [PATCH 1/2] iMesh_MOAB: do not allocate new memory for count=0 items
James Porter
jvporter at wisc.edu
Fri Jun 10 14:14:47 CDT 2011
On Fri, 2011-06-10 at 21:02 +0200, Jed Brown wrote:
> On Fri, Jun 10, 2011 at 20:59, James Porter <jvporter at wisc.edu> wrote:
> In any case, a better spec would simply be "if you want iMesh
> to
> allocate the array for you, pass NULL as the list pointer",
> (i.e. get
> rid of the case where alloc=0 means "allocate the array for
> me"). I'm
> not really sure why we need two ways to tell iMesh to allocate
> the array
> for us.
>
> Yes, this is what I am advocating.
That's not what your patch does, though. I think this sounds like a good
idea in general (I missed the first email that explained the context),
but I don't think "never allocate for 0-sized arrays" is the right way.
It just adds another layer of complexity to something that's already too
complicated to begin with.
To others: are there any reasons that we *need* to use alloc=0 to
indicate "please allocate this array for me" instead of array=NULL?
Would Fortran have problems with saying array=NULL?
- Jim
More information about the moab-dev
mailing list