summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-08 19:09:50 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-08 19:09:50 (GMT)
commit0f805b3aa507d557fbab6cc8ccec81b50daf6dd8 (patch)
tree10f5d92e41a140dd11711f7af0d845079601e87d /src/H5S.c
parent583bdf994cb40b4568a09657a0961392660ebdff (diff)
downloadhdf5-0f805b3aa507d557fbab6cc8ccec81b50daf6dd8.zip
hdf5-0f805b3aa507d557fbab6cc8ccec81b50daf6dd8.tar.gz
hdf5-0f805b3aa507d557fbab6cc8ccec81b50daf6dd8.tar.bz2
[svn-r8496] Purpose:
Code optimization Description: Further reduce the number of copies we make of a hyperslab selection for chunked I/O, especially when we are only going to throw the old selection away for a new one. Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.9 (sleipnir) w/parallel
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5S.c b/src/H5S.c
index f326860..a7ede59 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -566,7 +566,7 @@ H5Scopy(hid_t space_id)
HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
/* Copy */
- if (NULL==(dst=H5S_copy (src)))
+ if (NULL==(dst=H5S_copy (src, FALSE)))
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy data space");
/* Atomize */
@@ -691,7 +691,11 @@ done:
* Function: H5S_copy
*
* Purpose: Copies a data space, by copying the extent and selection through
- * H5S_extent_copy and H5S_select_copy
+ * H5S_extent_copy and H5S_select_copy. If the SHARE_SELECTION flag
+ * is set, then the selection can be shared between the source and
+ * destination dataspaces. (This should only occur in situations
+ * where the destination dataspace will immediately change to a new
+ * selection)
*
* Return: Success: A pointer to a new copy of SRC
*
@@ -705,7 +709,7 @@ done:
*-------------------------------------------------------------------------
*/
H5S_t *
-H5S_copy(const H5S_t *src)
+H5S_copy(const H5S_t *src, hbool_t share_selection)
{
H5S_t *dst = NULL;
H5S_t *ret_value; /* Return value */
@@ -725,7 +729,7 @@ H5S_copy(const H5S_t *src)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy extent");
/* Copy the source dataspace's selection */
- if (H5S_select_copy(dst,src)<0)
+ if (H5S_select_copy(dst,src,share_selection)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy select");
/* Set the return value */