diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-14 20:40:02 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-14 20:40:02 (GMT) |
commit | d66de6e699fbd5176ce7e4142e1e2a1f6d83af3a (patch) | |
tree | 3d85045eb9629ddd0268bd1d9b26ed76f3a92aea /src/H5Distore.c | |
parent | 1b919a11dacb836c7bd335021fa7b28a5bb3fe09 (diff) | |
download | hdf5-d66de6e699fbd5176ce7e4142e1e2a1f6d83af3a.zip hdf5-d66de6e699fbd5176ce7e4142e1e2a1f6d83af3a.tar.gz hdf5-d66de6e699fbd5176ce7e4142e1e2a1f6d83af3a.tar.bz2 |
[svn-r8687] Purpose:
Code optimization
Description:
Eliminate memcpy() when using default DXPL by pointing at existing
default object, instead of copying it.
Platforms tested:
Solaris 2.7 (arabica)
FreeBSD 4.10 (sleipnir) w/parallel
Too minor to require h5committest
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r-- | src/H5Distore.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c index 96f161d..9d30387 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -1098,7 +1098,8 @@ done: herr_t H5D_istore_flush (H5F_t *f, hid_t dxpl_id, H5D_t *dset, unsigned flags) { - H5D_dxpl_cache_t dxpl_cache; /* Cached data transfer properties */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ H5D_rdcc_t *rdcc = &(dset->cache.chunk); int nerrors=0; H5D_rdcc_ent_t *ent=NULL, *next=NULL; @@ -1117,10 +1118,10 @@ H5D_istore_flush (H5F_t *f, hid_t dxpl_id, H5D_t *dset, unsigned flags) ent->dirty = FALSE; } /* end if */ else if ((flags&H5F_FLUSH_INVALIDATE)) { - if (H5D_istore_preempt(f, &dxpl_cache, dxpl_id, dset, ent, TRUE )<0) + if (H5D_istore_preempt(f, dxpl_cache, dxpl_id, dset, ent, TRUE )<0) nerrors++; } else { - if (H5D_istore_flush_entry(f, &dxpl_cache, dxpl_id, dset, ent, FALSE)<0) + if (H5D_istore_flush_entry(f, dxpl_cache, dxpl_id, dset, ent, FALSE)<0) nerrors++; } } /* end for */ @@ -1153,7 +1154,8 @@ done: herr_t H5D_istore_dest (H5F_t *f, hid_t dxpl_id, H5D_t *dset) { - H5D_dxpl_cache_t dxpl_cache; /* Cached data transfer properties */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ H5D_rdcc_t *rdcc = &(dset->cache.chunk); int nerrors=0; H5D_rdcc_ent_t *ent=NULL, *next=NULL; @@ -1171,7 +1173,7 @@ H5D_istore_dest (H5F_t *f, hid_t dxpl_id, H5D_t *dset) HDfflush(stderr); #endif next = ent->next; - if (H5D_istore_preempt(f, &dxpl_cache, dxpl_id, dset, ent, TRUE )<0) + if (H5D_istore_preempt(f, dxpl_cache, dxpl_id, dset, ent, TRUE )<0) nerrors++; } if (nerrors) @@ -1963,7 +1965,8 @@ H5D_istore_allocated(H5F_t *f, hid_t dxpl_id, H5D_t *dset) { H5D_rdcc_t *rdcc = &(dset->cache.chunk); /*raw data chunk cache */ H5D_rdcc_ent_t *ent; /*cache entry */ - H5D_dxpl_cache_t dxpl_cache; /* Cached data transfer properties */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ H5D_istore_ud1_t udata; hsize_t ret_value; /* Return value */ @@ -1976,7 +1979,7 @@ H5D_istore_allocated(H5F_t *f, hid_t dxpl_id, H5D_t *dset) /* Search for cached chunks that haven't been written out */ for(ent = rdcc->head; ent; ent = ent->next) { /* Flush the chunk out to disk, to make certain the size is correct later */ - if (H5D_istore_flush_entry(f, &dxpl_cache, dxpl_id, dset, ent, FALSE)<0) + if (H5D_istore_flush_entry(f, dxpl_cache, dxpl_id, dset, ent, FALSE)<0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, 0, "cannot flush indexed storage buffer"); } /* end for */ @@ -2503,7 +2506,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_istore_prune_by_extent(H5F_t *f, const struct H5D_dxpl_cache_t *dxpl_cache, +H5D_istore_prune_by_extent(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, H5D_t *dset) { H5D_rdcc_t *rdcc = &(dset->cache.chunk); /*raw data chunk cache */ @@ -2941,7 +2944,8 @@ H5D_istore_update_cache(H5F_t *f, hid_t dxpl_id, H5D_t *dset) H5D_rdcc_t *rdcc = &(dset->cache.chunk); /*raw data chunk cache */ H5D_rdcc_ent_t *ent, *next; /*cache entry */ H5D_rdcc_ent_t *old_ent; /* Old cache entry */ - H5D_dxpl_cache_t dxpl_cache; /* Cached data transfer properties */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ int srank; /*current # of dimensions (signed) */ unsigned rank; /*current # of dimensions */ hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /*current dataspace dimensions */ @@ -2999,7 +3003,7 @@ H5D_istore_update_cache(H5F_t *f, hid_t dxpl_id, H5D_t *dset) next=old_ent->next; /* Remove the old entry from the cache */ - if (H5D_istore_preempt(f, &dxpl_cache, dxpl_id, dset, old_ent, TRUE )<0) + if (H5D_istore_preempt(f, dxpl_cache, dxpl_id, dset, old_ent, TRUE )<0) HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks"); } /* end if */ |