summaryrefslogtreecommitdiffstats
path: root/src/H5PB.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-05-11 23:06:23 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-11 23:06:23 (GMT)
commit92142cba386922cf7a087dbf26aef9c189cdef0b (patch)
tree44cf19857420a7fa1366ee144979744534c82aae /src/H5PB.c
parentcc6e4055cb47b08a131d5dc9d04495a81573b596 (diff)
downloadhdf5-92142cba386922cf7a087dbf26aef9c189cdef0b.zip
hdf5-92142cba386922cf7a087dbf26aef9c189cdef0b.tar.gz
hdf5-92142cba386922cf7a087dbf26aef9c189cdef0b.tar.bz2
When an entry changes size, remove it from the tick list and add it back
to keep the cumulative bytes in the tick list up-to-date. That prevents an assertion, later.
Diffstat (limited to 'src/H5PB.c')
-rw-r--r--src/H5PB.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/H5PB.c b/src/H5PB.c
index 81f3c54..f902cca 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -3982,11 +3982,21 @@ H5PB__write_meta(H5F_shared_t *shared, H5FD_mem_t type, haddr_t addr,
"couldn't extend entry");
}
H5PB__UPDATE_RP_FOR_REMOVE(pb_ptr, entry_ptr, FAIL)
+
+ /* To keep statistics for the index and the tick-list up-to-date,
+ * it's expedient to remove and re-insert entries there.
+ */
H5PB__DELETE_FROM_INDEX(pb_ptr, entry_ptr, FAIL)
+ if (entry_ptr->modified_this_tick)
+ H5PB__REMOVE_FROM_TL(pb_ptr, entry_ptr, FAIL)
+
entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr);
entry_ptr->image_ptr = new_image;
entry_ptr->is_mpmde = true;
entry_ptr->size = size;
+
+ if (entry_ptr->modified_this_tick)
+ H5PB__INSERT_IN_TL(pb_ptr, entry_ptr, FAIL)
H5PB__INSERT_IN_INDEX(pb_ptr, entry_ptr, FAIL)
}