summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorvchoi <vchoi@jelly.ad.hdfgroup.org>2021-08-10 19:38:10 (GMT)
committervchoi <vchoi@jelly.ad.hdfgroup.org>2021-08-10 19:38:10 (GMT)
commit81025a6e2578331beac3e2745e2717fba6576506 (patch)
treeabc5ce7d9697dbef050509ed24b2a326f94292d2 /src
parent0bb13dcf92a309d7668e8cda85f248b420934f29 (diff)
parent7a9af2bd7d33bd1beeadf16ac785454444bf4f6a (diff)
downloadhdf5-81025a6e2578331beac3e2745e2717fba6576506.zip
hdf5-81025a6e2578331beac3e2745e2717fba6576506.tar.gz
hdf5-81025a6e2578331beac3e2745e2717fba6576506.tar.bz2
Merge branch 'noflush_feature_vfd_swmr' of https://github.com/vchoi-hdfgroup/hdf5 into noflush_feature_vfd_swmr
Diffstat (limited to 'src')
-rw-r--r--src/H5Fvfd_swmr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c
index 3220443..7294494 100644
--- a/src/H5Fvfd_swmr.c
+++ b/src/H5Fvfd_swmr.c
@@ -1739,7 +1739,7 @@ vfd_swmr_enlarge_shadow_index(H5F_t *f)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "shadow-file allocation failed for index")
}
- new_mdf_idx = HDmalloc(new_mdf_idx_len * sizeof(new_mdf_idx[0]));
+ new_mdf_idx = H5MM_calloc(new_mdf_idx_len * sizeof(new_mdf_idx[0]));
if (new_mdf_idx == NULL) {
(void)H5MV_free(f, idx_addr, idx_size);
@@ -1757,6 +1757,11 @@ vfd_swmr_enlarge_shadow_index(H5F_t *f)
ret_value = shared->mdf_idx = new_mdf_idx;
shared->mdf_idx_len = new_mdf_idx_len;
+ H5MM_xfree(f->shared->old_mdf_idx);
+
+ shared->old_mdf_idx = old_mdf_idx;
+ f->shared->old_mdf_idx_len = old_mdf_idx_len;
+
/* Postpone reclamation of the old index until max_lag ticks from now.
* It's only necessary to wait until after the new index is in place,
* so it's possible that some disused shadow storage will build up