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/H5HFdblock.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/H5HFdblock.c')
-rw-r--r-- | src/H5HFdblock.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 7a511a0..e00dbf3 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -196,7 +196,8 @@ HDmemset(dblock->blk, 0, dblock->size); done: if(ret_value < 0) if(dblock) - (void)H5HF_cache_dblock_dest(hdr->f, dblock); + if(H5HF_man_dblock_dest(dblock) < 0) + HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF_man_dblock_create() */ @@ -640,3 +641,47 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF_man_dblock_delete() */ + +/*------------------------------------------------------------------------- + * Function: H5HF_man_dblock_dest + * + * Purpose: Destroys a fractal heap direct block in memory. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Feb 27 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_man_dblock_dest(H5HF_direct_t *dblock) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5HF_man_dblock_dest) + + /* + * Check arguments. + */ + HDassert(dblock); + + /* Decrement reference count on shared fractal heap info */ + HDassert(dblock->hdr != NULL); + if(H5HF_hdr_decr(dblock->hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") + if(dblock->parent) + if(H5HF_iblock_decr(dblock->parent) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") + + /* Free block's buffer */ + dblock->blk = H5FL_BLK_FREE(direct_block, dblock->blk); + + /* Free fractal heap direct block info */ + dblock = H5FL_FREE(H5HF_direct_t, dblock); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_man_dblock_dest() */ + |