diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-04-17 16:05:16 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-04-17 16:05:16 (GMT) |
commit | ebc1ff3f52c65ad1f4ca979fd1d8e1e2d4ca6ff6 (patch) | |
tree | 35059220d0122a08f945590b44688b9e7b272568 | |
parent | 97dc0abb96963614fe92c4d33f84cb7d6e11c39b (diff) | |
download | hdf5-ebc1ff3f52c65ad1f4ca979fd1d8e1e2d4ca6ff6.zip hdf5-ebc1ff3f52c65ad1f4ca979fd1d8e1e2d4ca6ff6.tar.gz hdf5-ebc1ff3f52c65ad1f4ca979fd1d8e1e2d4ca6ff6.tar.bz2 |
[svn-r8365] Purpose:
Code optimization
Description:
Eliminate memset() calls to clear structures that we completely initialize
Platforms tested:
Solaris 2.7 (arabica)
FreeBSD 4.9 (sleipnir)
too minor to require h5committest
-rw-r--r-- | src/H5Distore.c | 7 | ||||
-rw-r--r-- | src/H5Fistore.c | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c index 28d35b3..f602689 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -918,7 +918,6 @@ H5F_istore_flush_entry(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, H5F_rdcc_ent_t *ent, hbool_t reset) { herr_t ret_value=SUCCEED; /*return value */ - H5F_istore_ud1_t udata; /*pass through B-tree */ unsigned u; /*counters */ void *buf=NULL; /*temporary buffer */ size_t alloc; /*bytes allocated for BUF */ @@ -929,10 +928,11 @@ H5F_istore_flush_entry(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, assert(f); assert(ent); assert(!ent->locked); - HDmemset(&udata, 0, sizeof(H5F_istore_ud1_t)); buf = ent->chunk; if (ent->dirty) { + H5F_istore_ud1_t udata; /*pass through B-tree */ + udata.mesg = *(ent->layout); udata.key.filter_mask = 0; udata.addr = HADDR_UNDEF; @@ -1359,7 +1359,6 @@ H5F_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, con H5F_rdcc_t *rdcc = &(f->shared->rdcc);/*raw data chunk cache*/ H5F_rdcc_ent_t *ent = NULL; /*cache entry */ unsigned u; /*counters */ - H5F_istore_ud1_t udata; /*B-tree pass-through */ size_t chunk_size=0; /*size of a chunk */ herr_t status; /*func return status */ void *chunk=NULL; /*the file chunk */ @@ -1368,7 +1367,6 @@ H5F_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, con FUNC_ENTER_NOAPI_NOINIT(H5F_istore_lock); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); - HDmemset(&udata, 0, sizeof(H5F_istore_ud1_t)); if (rdcc->nslots>0) { for (u=0, temp_idx=0; u<layout->ndims; u++) { @@ -1414,6 +1412,7 @@ H5F_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, con HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk"); } else { + H5F_istore_ud1_t udata; /*B-tree pass-through */ /* * Not in the cache. Read it from the file and count this as a miss diff --git a/src/H5Fistore.c b/src/H5Fistore.c index 28d35b3..f602689 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -918,7 +918,6 @@ H5F_istore_flush_entry(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, H5F_rdcc_ent_t *ent, hbool_t reset) { herr_t ret_value=SUCCEED; /*return value */ - H5F_istore_ud1_t udata; /*pass through B-tree */ unsigned u; /*counters */ void *buf=NULL; /*temporary buffer */ size_t alloc; /*bytes allocated for BUF */ @@ -929,10 +928,11 @@ H5F_istore_flush_entry(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, assert(f); assert(ent); assert(!ent->locked); - HDmemset(&udata, 0, sizeof(H5F_istore_ud1_t)); buf = ent->chunk; if (ent->dirty) { + H5F_istore_ud1_t udata; /*pass through B-tree */ + udata.mesg = *(ent->layout); udata.key.filter_mask = 0; udata.addr = HADDR_UNDEF; @@ -1359,7 +1359,6 @@ H5F_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, con H5F_rdcc_t *rdcc = &(f->shared->rdcc);/*raw data chunk cache*/ H5F_rdcc_ent_t *ent = NULL; /*cache entry */ unsigned u; /*counters */ - H5F_istore_ud1_t udata; /*B-tree pass-through */ size_t chunk_size=0; /*size of a chunk */ herr_t status; /*func return status */ void *chunk=NULL; /*the file chunk */ @@ -1368,7 +1367,6 @@ H5F_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, con FUNC_ENTER_NOAPI_NOINIT(H5F_istore_lock); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); - HDmemset(&udata, 0, sizeof(H5F_istore_ud1_t)); if (rdcc->nslots>0) { for (u=0, temp_idx=0; u<layout->ndims; u++) { @@ -1414,6 +1412,7 @@ H5F_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, con HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk"); } else { + H5F_istore_ud1_t udata; /*B-tree pass-through */ /* * Not in the cache. Read it from the file and count this as a miss |