diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-04-02 03:10:56 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-04-02 03:10:56 (GMT) |
commit | 13431c248eca79cff09f66824869e722286f0510 (patch) | |
tree | 0553925619b4b3925c38f92f5322b921df634fe2 /src/H5HFiblock.c | |
parent | 63611c3aa26d64aeee583ef88316290c4a85c123 (diff) | |
download | hdf5-13431c248eca79cff09f66824869e722286f0510.zip hdf5-13431c248eca79cff09f66824869e722286f0510.tar.gz hdf5-13431c248eca79cff09f66824869e722286f0510.tar.bz2 |
[svn-r18498] Description:
Bring r18497 from metadata journaling "merging" branch to trunk:
Extract data structure 'destroy' routines from metadata cache client
'destroy' callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5HFiblock.c')
-rw-r--r-- | src/H5HFiblock.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 26c60a3..74fbe63 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -1046,7 +1046,8 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo done: if(ret_value < 0) if(iblock) - (void)H5HF_cache_iblock_dest(hdr->f, iblock); + if(H5HF_man_iblock_dest(iblock) < 0) + HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF_man_iblock_create() */ @@ -1557,3 +1558,53 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF_man_iblock_size() */ + +/*------------------------------------------------------------------------- + * Function: H5HF_man_iblock_dest + * + * Purpose: Destroys a fractal heap indirect block in memory. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Mar 6 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_man_iblock_dest(H5HF_indirect_t *iblock) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_dest) + + /* + * Check arguments. + */ + HDassert(iblock); + HDassert(iblock->rc == 0); + + /* Decrement reference count on shared info */ + HDassert(iblock->hdr); + if(H5HF_hdr_decr(iblock->hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") + if(iblock->parent) + if(H5HF_iblock_decr(iblock->parent) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") + + /* Release entry tables */ + if(iblock->ents) + H5FL_SEQ_FREE(H5HF_indirect_ent_t, iblock->ents); + if(iblock->filt_ents) + H5FL_SEQ_FREE(H5HF_indirect_filt_ent_t, iblock->filt_ents); + if(iblock->child_iblocks) + H5FL_SEQ_FREE(H5HF_indirect_ptr_t, iblock->child_iblocks); + + /* Free fractal heap indirect block info */ + iblock = H5FL_FREE(H5HF_indirect_t, iblock); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_man_iblock_dest() */ + |