summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-11-20 10:50:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-11-20 10:50:18 (GMT)
commit6a5559be99224fd6693f0b11fe31ad61e211f6cb (patch)
treec6694dca77b05351824312d5fbd3ddf9d37520dd /src/H5S.c
parentb4f4670c811cae49e08f1799b6ea69a8bb1345f3 (diff)
downloadhdf5-6a5559be99224fd6693f0b11fe31ad61e211f6cb.zip
hdf5-6a5559be99224fd6693f0b11fe31ad61e211f6cb.tar.gz
hdf5-6a5559be99224fd6693f0b11fe31ad61e211f6cb.tar.bz2
[svn-r14271] Description:
Avoid copying maximum dimensions for temporary dataspaces used for describing chunks during raw data I/O. Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/H5S.c b/src/H5S.c
index f990925..8a498aa 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -542,7 +542,7 @@ H5Scopy(hid_t space_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
/* Copy */
- if (NULL==(dst=H5S_copy (src, FALSE)))
+ if (NULL == (dst = H5S_copy(src, FALSE, TRUE)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy data space")
/* Atomize */
@@ -580,22 +580,22 @@ H5Sextent_copy(hid_t dst_id,hid_t src_id)
H5S_t *dst;
hid_t ret_value = SUCCEED;
- FUNC_ENTER_API(H5Sextent_copy, FAIL);
+ FUNC_ENTER_API(H5Sextent_copy, FAIL)
H5TRACE2("e", "ii", dst_id, src_id);
/* Check args */
- if (NULL==(src=(H5S_t *)H5I_object_verify(src_id, H5I_DATASPACE)))
+ if(NULL == (src = (H5S_t *)H5I_object_verify(src_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
- if (NULL==(dst=(H5S_t *)H5I_object_verify(dst_id, H5I_DATASPACE)))
+ if(NULL == (dst = (H5S_t *)H5I_object_verify(dst_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
/* Copy */
- if (H5S_extent_copy(&(dst->extent),&(src->extent))<0)
+ if(H5S_extent_copy(&(dst->extent), &(src->extent), TRUE) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent")
done:
- FUNC_LEAVE_API(ret_value);
-}
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Sextent_copy() */
/*-------------------------------------------------------------------------
@@ -613,7 +613,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src)
+H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max)
{
unsigned u;
herr_t ret_value = SUCCEED; /* Return value */
@@ -641,13 +641,13 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src)
} /* end if */
else
dst->size = NULL;
- if(src->max) {
+ if(copy_max && src->max) {
dst->max = (hsize_t *)H5FL_ARR_MALLOC(hsize_t, (size_t)src->rank);
for(u = 0; u < src->rank; u++)
dst->max[u] = src->max[u];
} /* end if */
else
- dst->max=NULL;
+ dst->max = NULL;
break;
default:
@@ -686,7 +686,7 @@ done:
*-------------------------------------------------------------------------
*/
H5S_t *
-H5S_copy(const H5S_t *src, hbool_t share_selection)
+H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max)
{
H5S_t *dst = NULL;
H5S_t *ret_value; /* Return value */
@@ -697,7 +697,7 @@ H5S_copy(const H5S_t *src, hbool_t share_selection)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Copy the source dataspace's extent */
- if(H5S_extent_copy(&(dst->extent), &(src->extent)) < 0)
+ if(H5S_extent_copy(&(dst->extent), &(src->extent), copy_max) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy extent")
/* Copy the source dataspace's selection */