summaryrefslogtreecommitdiffstats
path: root/src/H5Sselect.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-13 23:26:04 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-13 23:26:04 (GMT)
commit8f0a7d94658fe28559b8f351a434800285b33ce9 (patch)
tree688b637e3cef2540f86d1326c0dbdacdacbb4abb /src/H5Sselect.c
parentf3b26a8ce9798d8ce8c4b845b407778b4084b6d4 (diff)
downloadhdf5-8f0a7d94658fe28559b8f351a434800285b33ce9.zip
hdf5-8f0a7d94658fe28559b8f351a434800285b33ce9.tar.gz
hdf5-8f0a7d94658fe28559b8f351a434800285b33ce9.tar.bz2
[svn-r8519] 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.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index d20c3a7..6e70a31 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_SCALAR:
@@ -216,10 +198,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);