summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-06 18:51:26 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-06 18:51:26 (GMT)
commitb230f3eb22e16932dc664970ade0021831e2fc5f (patch)
treeb72c6bc2f2f9a6fafef1906159794c9b3d56e378 /src/H5Shyper.c
parent45878f9a8adac2d93c8a6ba42e09fff043d41adb (diff)
downloadhdf5-b230f3eb22e16932dc664970ade0021831e2fc5f.zip
hdf5-b230f3eb22e16932dc664970ade0021831e2fc5f.tar.gz
hdf5-b230f3eb22e16932dc664970ade0021831e2fc5f.tar.bz2
[svn-r8312] Purpose:
Code optimization Description: Eliminate unnecessary allocation and point at existing data structure instead. Platforms tested: Solaris 2.7 (arabica) too minor to require h5committest
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 49279c9..d7aae0b 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -6151,8 +6151,8 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
const hsize_t count[],
const hsize_t *block)
{
- hsize_t *_stride=NULL; /* Stride array */
- hsize_t *_block=NULL; /* Block size array */
+ hsize_t _stride[H5O_LAYOUT_NDIMS]; /* Stride array */
+ hsize_t _block[H5O_LAYOUT_NDIMS]; /* Block size array */
unsigned u; /* Counters */
H5S_hyper_dim_t *diminfo; /* per-dimension info for the selection */
herr_t ret_value=SUCCEED; /* Return value */
@@ -6169,9 +6169,6 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
if(stride==NULL) {
hsize_t fill=1;
- /* Allocate temporary buffer */
- if ((_stride=H5FL_ARR_MALLOC(hsize_t,space->extent.u.simple.rank))==NULL)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for stride buffer");
H5V_array_fill(_stride,&fill,sizeof(hssize_t),space->extent.u.simple.rank);
stride = _stride;
} /* end if */
@@ -6180,9 +6177,6 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
if(block==NULL) {
hsize_t fill=1;
- /* Allocate temporary buffer */
- if ((_block=H5FL_ARR_MALLOC(hsize_t,space->extent.u.simple.rank))==NULL)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for stride buffer");
H5V_array_fill(_block,&fill,sizeof(hssize_t),space->extent.u.simple.rank);
block = _block;
} /* end if */
@@ -6352,10 +6346,6 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
done:
- if(_stride!=NULL)
- H5FL_ARR_FREE(hsize_t,_stride);
- if(_block!=NULL)
- H5FL_ARR_FREE(hsize_t,_block);
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_select_hyperslab() */