diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-05-13 23:26:10 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-05-13 23:26:10 (GMT) |
commit | 6a806870e9938bf0651a7513c109489687b016bb (patch) | |
tree | ae62a7792ac7b1e851af807bfee6013e613cec1d /src/H5Sselect.c | |
parent | a9d354fd9592b44f250eb42efe450e26b7fd0d17 (diff) | |
download | hdf5-6a806870e9938bf0651a7513c109489687b016bb.zip hdf5-6a806870e9938bf0651a7513c109489687b016bb.tar.gz hdf5-6a806870e9938bf0651a7513c109489687b016bb.tar.bz2 |
[svn-r8520] Purpose:
Code optimization
Description:
Don't make a separate allocation for the selection offset - incorporate
it into the selection structure as a fixed size array.
Platforms tested:
Solaris 2.7 (arabica)
FreeBSD 4.9 (sleipnir) w/parallel
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r-- | src/H5Sselect.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 1e79410..daf40cd 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -85,12 +85,6 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset) assert(space->extent.u.simple.rank); assert(offset); - /* Allocate space for new offset */ - if(space->select.offset==NULL) { - if (NULL==(space->select.offset = H5FL_ARR_MALLOC(hssize_t,space->extent.u.simple.rank))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - } - /* Copy the offset over */ HDmemcpy(space->select.offset,offset,sizeof(hssize_t)*space->extent.u.simple.rank); @@ -139,18 +133,6 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) /* Need to copy permutation order information still */ - /* Copy offset information */ - if(src->extent.u.simple.rank>0) { - if (NULL==(dst->select.offset = H5FL_ARR_MALLOC(hssize_t,src->extent.u.simple.rank))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - if(src->select.offset==NULL) - HDmemset(dst->select.offset,0,(src->extent.u.simple.rank*sizeof(hssize_t))); - else - HDmemcpy(dst->select.offset,src->select.offset,(src->extent.u.simple.rank*sizeof(hssize_t))); - } /* end if */ - else - dst->select.offset=NULL; - /* Perform correct type of copy based on the type of selection */ switch (src->extent.type) { case H5S_NULL: @@ -217,10 +199,6 @@ H5S_select_release(H5S_t *ds) assert(ds); - /* If there was a previous offset for the selection, release it */ - if(ds->select.offset!=NULL) - ds->select.offset=H5FL_ARR_FREE(hssize_t,ds->select.offset); - /* Call the selection type's release function */ (*ds->select.release)(ds); |