summaryrefslogtreecommitdiffstats
path: root/src/H5Gnode.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/H5Gnode.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/H5Gnode.c')
-rw-r--r--src/H5Gnode.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 2f20a2c..a7880b4 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -70,7 +70,7 @@ static H5G_node_t *H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const vo
static herr_t H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5G_node_t *sym);
static herr_t H5G_node_dest(H5F_t *f, H5G_node_t *sym);
-static herr_t H5G_node_clear(H5G_node_t *sym);
+static herr_t H5G_node_clear(H5G_node_t *sym, hbool_t destroy);
/* B-tree callbacks */
static size_t H5G_node_sizeof_rkey(H5F_t *f, const void *_udata);
@@ -550,9 +550,10 @@ H5G_node_dest(H5F_t UNUSED *f, H5G_node_t *sym)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_clear(H5G_node_t *sym)
+H5G_node_clear(H5G_node_t *sym, hbool_t destroy)
{
int i; /* Local index variable */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOINIT(H5G_node_clear);
@@ -567,7 +568,16 @@ H5G_node_clear(H5G_node_t *sym)
sym->entry[i].dirty=FALSE;
sym->cache_info.dirty = FALSE;
- FUNC_LEAVE_NOAPI(SUCCEED);
+ /*
+ * Destroy the symbol node? This might happen if the node is being
+ * preempted from the cache.
+ */
+ if (destroy)
+ if (H5G_node_dest(NULL, sym) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
} /* end H5G_node_clear() */