summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-08 19:10:01 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-08 19:10:01 (GMT)
commiteb0f0ad28736bf01b57cfb65e41a6a43690f1774 (patch)
treecf1c7fc3df235bf40682039c447fe1b838b4373a /src/H5S.c
parentf646f060eab9019d4c6bbd661f856dad024457cb (diff)
downloadhdf5-eb0f0ad28736bf01b57cfb65e41a6a43690f1774.zip
hdf5-eb0f0ad28736bf01b57cfb65e41a6a43690f1774.tar.gz
hdf5-eb0f0ad28736bf01b57cfb65e41a6a43690f1774.tar.bz2
[svn-r8497] 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 c5385a5..1ee34fb 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 */
@@ -690,7 +690,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
*
@@ -704,7 +708,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 */
@@ -724,7 +728,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 */