summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-03-31 17:54:10 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-03-31 17:54:10 (GMT)
commit817756a0e0a84a376e3c399f13ff495fde7a10a4 (patch)
treef3098b7e2d0d02bddefa96c6b7f117b88ccb7fcf /src
parentda70686a5a22cd150e2be95d0b5f8b61dc50abe4 (diff)
downloadhdf5-817756a0e0a84a376e3c399f13ff495fde7a10a4.zip
hdf5-817756a0e0a84a376e3c399f13ff495fde7a10a4.tar.gz
hdf5-817756a0e0a84a376e3c399f13ff495fde7a10a4.tar.bz2
Rename process_deferred_frees as H5MF_process_deferred_frees and make it
available to other files. Make the tick number a parameter instead of using the f->shared->tick_num, so that we can pass a maximal tick number and that way reclaim all of the deferred frees.
Diffstat (limited to 'src')
-rw-r--r--src/H5MF.c13
-rw-r--r--src/H5MFprivate.h2
2 files changed, 8 insertions, 7 deletions
diff --git a/src/H5MF.c b/src/H5MF.c
index 7c354a5..d8f3f39 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -167,19 +167,18 @@ defer_free(H5F_shared_t *shared, H5FD_mem_t alloc_type, haddr_t addr,
return SUCCEED;
}
-static herr_t
-process_deferred_frees(H5F_t *f)
+herr_t
+H5MF_process_deferred_frees(H5F_t *f, const uint64_t tick_num)
{
lower_defree_t *df;
herr_t err = SUCCEED;
H5F_shared_t *shared = f->shared;
- const uint64_t tick_num = shared->tick_num;
lower_defree_queue_t defrees = SIMPLEQ_HEAD_INITIALIZER(defrees);
/* Have to empty the queue before processing it because we
* could re-enter this routine through H5MF__xfree_impl. If
- * items were still on the queue, we would enter process_deferred_frees()
- * recursively until the queue was empty.
+ * items were still on the queue, we would enter
+ * H5MF_process_deferred_frees() recursively until the queue was empty.
*/
SIMPLEQ_CONCAT(&defrees, &shared->lower_defrees);
@@ -883,7 +882,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
if (!f->shared->vfd_swmr_writer)
; // not a VFD SWMR writer, do not process deferrals
- else if (process_deferred_frees(f) < 0) {
+ else if (H5MF_process_deferred_frees(f, f->shared->tick_num) < 0) {
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, HADDR_UNDEF,
"could not process deferrals")
}
@@ -1192,7 +1191,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
ret_value = H5MF__xfree_impl(f, alloc_type, addr, size);
} else if (defer_free(f->shared, alloc_type, addr, size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "could not defer")
- else if (process_deferred_frees(f) < 0) {
+ else if (H5MF_process_deferred_frees(f, f->shared->tick_num) < 0) {
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL,
"could not process deferrals")
}
diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h
index de1bdfb..0b294f8 100644
--- a/src/H5MFprivate.h
+++ b/src/H5MFprivate.h
@@ -67,6 +67,8 @@ H5_DLL ssize_t H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects,
/* File 'temporary' space allocation routines */
H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size);
+herr_t H5MF_process_deferred_frees(H5F_t *, uint64_t);
+
/* 'block aggregator' routines */
H5_DLL herr_t H5MF_free_aggrs(H5F_t *f);
H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f);