summaryrefslogtreecommitdiffstats
path: root/src/H5B.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/H5B.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/H5B.c')
-rw-r--r--src/H5B.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/H5B.c b/src/H5B.c
index 965c2e4..0f0f94a 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -154,7 +154,7 @@ static herr_t H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_
static H5B_t *H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata);
static herr_t H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b);
static herr_t H5B_dest(H5F_t *f, H5B_t *b);
-static herr_t H5B_clear(H5B_t *b);
+static herr_t H5B_clear(H5B_t *b, hbool_t destroy);
/* H5B inherits cache-like properties from H5AC */
static const H5AC_class_t H5AC_BT[1] = {{
@@ -560,9 +560,10 @@ H5B_dest(H5F_t UNUSED *f, H5B_t *bt)
*-------------------------------------------------------------------------
*/
static herr_t
-H5B_clear(H5B_t *bt)
+H5B_clear(H5B_t *bt, hbool_t destroy)
{
unsigned u; /* Local index variable */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOINIT(H5B_clear)
@@ -575,8 +576,13 @@ H5B_clear(H5B_t *bt)
for (u=0; u<=bt->nchildren; u++)
bt->key[u].dirty = FALSE;
bt->cache_info.dirty = FALSE;
+
+ if (destroy)
+ if (H5B_dest(NULL, bt) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node");
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
} /* end H5B_clear() */