summaryrefslogtreecommitdiffstats
path: root/src/H5HG.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-08-15 00:30:21 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-08-15 00:30:21 (GMT)
commitad13ea65abf246f25841f1bb32ee232c1767b9df (patch)
tree0ced53d37b2689643234f6919cc5f101bc905081 /src/H5HG.c
parentef90db21a40b8892b79991ecb66b29b305e102de (diff)
downloadhdf5-ad13ea65abf246f25841f1bb32ee232c1767b9df.zip
hdf5-ad13ea65abf246f25841f1bb32ee232c1767b9df.tar.gz
hdf5-ad13ea65abf246f25841f1bb32ee232c1767b9df.tar.bz2
[svn-r7367] Purpose:
Update Description: Added an extra flag to the clear functions that triggers a "destroy" of the object being cleared if necessary. This is a fix for the FPHDF5 stuff which had an object sticking around after it was cleared. (In FPHDF5, some processes are in charge of destroying the object, but all processes might actually allocate the object.) Platforms tested: AIX (Copper: Fortran & C++) Linux (Verbena: Fortran & C++) IRIX (Modi4: Parallel & Fortran) (Sol is down) Misc. update:
Diffstat (limited to 'src/H5HG.c')
-rw-r--r--src/H5HG.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/H5HG.c b/src/H5HG.c
index 57a3320..679b301 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -119,7 +119,7 @@ static H5HG_heap_t *H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void
static herr_t H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
H5HG_heap_t *heap);
static herr_t H5HG_dest(H5F_t *f, H5HG_heap_t *heap);
-static herr_t H5HG_clear(H5HG_heap_t *heap);
+static herr_t H5HG_clear(H5HG_heap_t *heap, hbool_t destroy);
/*
* H5HG inherits cache-like properties from H5AC
@@ -519,7 +519,7 @@ H5HG_dest (H5F_t *f, H5HG_heap_t *heap)
*-------------------------------------------------------------------------
*/
static herr_t
-H5HG_clear(H5HG_heap_t *heap)
+H5HG_clear(H5HG_heap_t *heap, hbool_t destroy)
{
FUNC_ENTER_NOINIT(H5HG_clear);
@@ -529,6 +529,12 @@ H5HG_clear(H5HG_heap_t *heap)
/* Mark heap as clean */
heap->cache_info.dirty = 0;
+ if (destroy) {
+ heap->chunk = H5FL_BLK_FREE(heap_chunk,heap->chunk);
+ heap->obj = H5FL_ARR_FREE(H5HG_obj_t,heap->obj);
+ H5FL_FREE(H5HG_heap_t, heap);
+ }
+
FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5HG_clear() */