summaryrefslogtreecommitdiffstats
path: root/src/H5HL.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2011-10-14 17:42:22 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2011-10-14 17:42:22 (GMT)
commitfe325096738d36828011ce02a0fc9b88ef3a660c (patch)
tree67d6617011d0e5b3f7e736f5838c4143ee2fe4f0 /src/H5HL.c
parent3feb0d880d960f0da89047914cd4358f16b92144 (diff)
downloadhdf5-fe325096738d36828011ce02a0fc9b88ef3a660c.zip
hdf5-fe325096738d36828011ce02a0fc9b88ef3a660c.tar.gz
hdf5-fe325096738d36828011ce02a0fc9b88ef3a660c.tar.bz2
[svn-r21566] Description:
Bring r21561 from trunk back to 1.8 branch: Correct error in loading local heap prefix & data block from the file. Sometimes the local heap's prefix could be loaded before the data block (e.g. using H5Oget_info), but then when the data block was loaded later, the free list information would get lost, causing the heap's size to grow larger than necessary. This is Jira bug #HDFFV-7767 Tested on: Mac OS X/32 10.7.2 (amazon) w/debug (h5committest coming up)
Diffstat (limited to 'src/H5HL.c')
-rw-r--r--src/H5HL.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/H5HL.c b/src/H5HL.c
index d806308..e37eb9f 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -153,9 +153,12 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/)
heap->freelist->offset = 0;
heap->freelist->size = size_hint;
heap->freelist->prev = heap->freelist->next = NULL;
+ heap->free_block = 0;
} /* end if */
- else
+ else {
heap->freelist = NULL;
+ heap->free_block = H5HL_FREE_NULL;
+ } /* end else */
/* Allocate the heap prefix */
if(NULL == (prfx = H5HL_prfx_new(heap)))
@@ -459,8 +462,6 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw)
prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f);
prfx_udata.prfx_addr = addr;
prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f);
- prfx_udata.loaded = FALSE;
- prfx_udata.free_block = H5HL_FREE_NULL;
/* Protect the local heap prefix */
if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, rw)))
@@ -482,8 +483,6 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw)
/* Construct the user data for protect callback */
dblk_udata.heap = heap;
- dblk_udata.free_block = prfx_udata.loaded ? prfx_udata.free_block :
- (heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL);
dblk_udata.loaded = FALSE;
/* Protect the local heap data block */
@@ -1076,8 +1075,6 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)
prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f);
prfx_udata.prfx_addr = addr;
prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f);
- prfx_udata.loaded = FALSE;
- prfx_udata.free_block = H5HL_FREE_NULL;
/* Protect the local heap prefix */
if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_WRITE)))
@@ -1092,8 +1089,6 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)
/* Construct the user data for protect callback */
dblk_udata.heap = heap;
- dblk_udata.free_block = prfx_udata.loaded ? prfx_udata.free_block :
- (heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL);
dblk_udata.loaded = FALSE;
/* Protect the local heap data block */
@@ -1156,8 +1151,6 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size)
prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f);
prfx_udata.prfx_addr = addr;
prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f);
- prfx_udata.loaded = FALSE;
- prfx_udata.free_block = H5HL_FREE_NULL;
/* Protect the local heap prefix */
if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_READ)))
@@ -1210,8 +1203,6 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size)
prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f);
prfx_udata.prfx_addr = addr;
prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f);
- prfx_udata.loaded = FALSE;
- prfx_udata.free_block = H5HL_FREE_NULL;
/* Protect the local heap prefix */
if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_READ)))