summaryrefslogtreecommitdiffstats
path: root/src/H5HL.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-16 20:48:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-16 20:48:40 (GMT)
commitc97fddc786356a1832e6cb3ac3f28b781d01584d (patch)
treee9ea99bbf3387f45b18d3b6503597a1c63662cab /src/H5HL.c
parentcb516077680041aecc338936d1aa3f84347e0e0d (diff)
downloadhdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.zip
hdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.tar.gz
hdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.tar.bz2
[svn-r8892] Purpose:
Code cleanup Description: Clean up a bunch of warnings and bring new code better inline with current library coding practice. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest Misc. update:
Diffstat (limited to 'src/H5HL.c')
-rw-r--r--src/H5HL.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/H5HL.c b/src/H5HL.c
index bfbb2ac..e0202f2 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -341,7 +341,7 @@ H5HL_minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap)
* When the heap is being flushed to disk, release the file space reserved
* for it.
*/
- H5MF_free_reserved(f, heap->disk_resrv);
+ H5MF_free_reserved(f, (hsize_t)heap->disk_resrv);
heap->disk_resrv = 0;
/*
@@ -1021,7 +1021,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t buf_size, const void *
else
disk_resrv = heap->mem_alloc + need_more - heap->disk_resrv;
- if( H5MF_reserve(f, disk_resrv) < 0 )
+ if( H5MF_reserve(f, (hsize_t)disk_resrv) < 0 )
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, (size_t)(-1), "unable to reserve space in file");
/* Update heap's record of how much space it has reserved */
@@ -1359,8 +1359,15 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free local heap data");
} /* end else */
+ /* Release the local heap metadata from the cache */
+ if (H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, TRUE)<0) {
+ heap = NULL;
+ HGOTO_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release local heap");
+ }
+ heap = NULL;
+
done:
- if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, TRUE)<0)
+ if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, FALSE)<0)
HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release local heap");
FUNC_LEAVE_NOAPI(ret_value);