diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-15 14:59:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-15 14:59:22 (GMT) |
commit | a0fe318aac5bbe01a95e9709012ac7eff0f51c4c (patch) | |
tree | 33239590f1bfd1198f5530f26523a29f7c128591 /src | |
parent | 33a566ea9bdcdbd97dd5df5c8fb7d8ed418246a9 (diff) | |
download | hdf5-a0fe318aac5bbe01a95e9709012ac7eff0f51c4c.zip hdf5-a0fe318aac5bbe01a95e9709012ac7eff0f51c4c.tar.gz hdf5-a0fe318aac5bbe01a95e9709012ac7eff0f51c4c.tar.bz2 |
[svn-r8691] 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 | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 0a2f084..c93c704 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1453,9 +1453,6 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s } /* end else */ } /* end else */ -#ifdef LATER -done: -#endif /* LATER */ FUNC_LEAVE_NOAPI(ret_value); } /* H5S_hyper_cmp_spans() */ @@ -1582,6 +1579,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); @@ -1593,8 +1592,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) */ |