diff options
author | David Young <dyoung@hdfgroup.org> | 2020-05-11 23:06:23 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-11 23:06:23 (GMT) |
commit | 92142cba386922cf7a087dbf26aef9c189cdef0b (patch) | |
tree | 44cf19857420a7fa1366ee144979744534c82aae /src/H5PB.c | |
parent | cc6e4055cb47b08a131d5dc9d04495a81573b596 (diff) | |
download | hdf5-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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) } |