summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.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/H5Shyper.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/H5Shyper.c')
-rw-r--r--src/H5Shyper.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 22c1541..169d58a 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -1557,13 +1557,18 @@ done:
DESCRIPTION
Copies all the hyperslab selection information from the source
dataspace to the destination dataspace.
+
+ 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)
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_hyper_copy (H5S_t *dst, const H5S_t *src)
+H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection)
{
herr_t ret_value=SUCCEED; /* return value */
@@ -1575,8 +1580,14 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src)
/* Check if there is hyperslab span information to copy */
/* (Regular hyperslab information is copied with the selection structure) */
if(src->select.sel_info.hslab.span_lst!=NULL) {
- /* Copy the hyperslab span information */
- dst->select.sel_info.hslab.span_lst=H5S_hyper_copy_span(src->select.sel_info.hslab.span_lst);
+ if(share_selection) {
+ /* Share the source's span tree by incrementing the reference count on it */
+ dst->select.sel_info.hslab.span_lst=src->select.sel_info.hslab.span_lst;
+ dst->select.sel_info.hslab.span_lst->count++;
+ } /* end if */
+ else
+ /* Copy the hyperslab span information */
+ dst->select.sel_info.hslab.span_lst=H5S_hyper_copy_span(src->select.sel_info.hslab.span_lst);
} /* end if */
done: