summaryrefslogtreecommitdiffstats
path: root/src/H5HLcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5HLcache.c')
-rw-r--r--src/H5HLcache.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index 238dce6..51d60f9 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -330,6 +330,11 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Check if the current buffer from the speculative read already has the heap data */
if(spec_read_size >= (heap->prfx_size + heap->dblk_size)) {
+ /* Set p to the start of the data block. This is necessary
+ * because there may be a gap between the used portion of the
+ * prefix and the data block due to alignment constraints. */
+ p = buf + heap->prfx_size;
+
/* Copy the heap data from the speculative read buffer */
HDmemcpy(heap->dblk_image, p, heap->dblk_size);
} /* end if */
@@ -435,6 +440,11 @@ H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
/* Check if the local heap is a single object in cache */
if(heap->single_cache_obj) {
+ /* Set p to the start of the data block. This is necessary because
+ * there may be a gap between the used portion of the prefix and the
+ * data block due to alignment constraints. */
+ p = buf + heap->prfx_size;
+
/* Serialize the free list into the heap data's image */
H5HL_fl_serialize(heap);