diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-15 14:58:39 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-15 14:58:39 (GMT) |
commit | 193fc7a70fe457725a213ab9b0bebcb0df502ec1 (patch) | |
tree | 5b4ec4c666b904b98c82df53c9565d59a3ee5d5c /src | |
parent | 435c8b2d7d58f361b8a74ff5bf8e53333b5f6878 (diff) | |
download | hdf5-193fc7a70fe457725a213ab9b0bebcb0df502ec1.zip hdf5-193fc7a70fe457725a213ab9b0bebcb0df502ec1.tar.gz hdf5-193fc7a70fe457725a213ab9b0bebcb0df502ec1.tar.bz2 |
[svn-r8690] Purpose:
Code optimization
Description:
Be smarter about copying hyperslab selection data and avoid memcpy() calls.
Platforms tested:
Solaris 2.7 (arabica)
FreeBSD 4.10 (sleipnir) w/parallel
Too minor to require h5committest
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Shyper.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 809474b..c9acb26 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1583,6 +1583,8 @@ done: herr_t H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) { + H5S_hyper_sel_t *dst_hslab; /* Pointer to destination hyperslab info */ + const H5S_hyper_sel_t *src_hslab; /* Pointer to source hyperslab info */ herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_NOAPI(H5S_hyper_copy, FAIL); @@ -1594,8 +1596,21 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) if((dst->select.sel_info.hslab=H5FL_MALLOC(H5S_hyper_sel_t))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info"); + /* Set temporary pointers */ + dst_hslab=dst->select.sel_info.hslab; + src_hslab=src->select.sel_info.hslab; + /* Copy the hyperslab information */ - HDmemcpy(dst->select.sel_info.hslab,src->select.sel_info.hslab,sizeof(H5S_hyper_sel_t)); + dst_hslab->diminfo_valid=src_hslab->diminfo_valid; + if(src_hslab->diminfo_valid) { + size_t u; /* Local index variable */ + + for(u=0; u<src->extent.rank; u++) { + dst_hslab->opt_diminfo[u]=src_hslab->opt_diminfo[u]; + dst_hslab->app_diminfo[u]=src_hslab->app_diminfo[u]; + } /* end for */ + } /* end if */ + dst->select.sel_info.hslab->span_lst=src->select.sel_info.hslab->span_lst; /* Check if there is hyperslab span information to copy */ /* (Regular hyperslab information is copied with the selection structure) */ |