diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-04-15 21:11:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-04-15 21:11:42 (GMT) |
commit | c83c1eb42d2ac0c252b13fa125d8bb4c0fc4665b (patch) | |
tree | 68192e89b3d768aa69dc5b4d618359cfcc78a30b /src/H5HFtest.c | |
parent | 838b4449cfb3271aa7c13f811e7e91c5beb7560b (diff) | |
download | hdf5-c83c1eb42d2ac0c252b13fa125d8bb4c0fc4665b.zip hdf5-c83c1eb42d2ac0c252b13fa125d8bb4c0fc4665b.tar.gz hdf5-c83c1eb42d2ac0c252b13fa125d8bb4c0fc4665b.tar.bz2 |
[svn-r12258] Purpose:
Code checkpoint
Description:
Add in more fractal heap support for odd allocation patterns (entries that
are too large for various block sizes, etc.)
Broke out fractal heap code into more source code modules.
Refactored fractal heap test to make it more understandable and
maintainable for the long term.
Platforms tested:
FreeBSD 4.11 (sleipnir)
Linux 2.4 (heping)
Linux 2.4/64 (mir)
Solaris 2.9 (shanti)
Diffstat (limited to 'src/H5HFtest.c')
-rw-r--r-- | src/H5HFtest.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/H5HFtest.c b/src/H5HFtest.c index 02024b9..c01475c 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -113,3 +113,46 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5HF_get_cparam_test() */ + +/*------------------------------------------------------------------------- + * Function: H5HF_get_dblock_free_test + * + * Purpose: Retrieve the size of direct block free space for a given + * direct or indirect block size + * + * Return: Success: Size of direct block free space + * + * Failure: 0 + * + * Programmer: Quincey Koziol + * Monday, April 10, 2006 + * + *------------------------------------------------------------------------- + */ +hsize_t +H5HF_get_dblock_free_test(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, unsigned row) +{ + H5HF_t *hdr = NULL; /* Pointer to the fractal heap header */ + hsize_t ret_value; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5HF_get_dblock_free_test) + + /* Check arguments. */ + HDassert(f); + HDassert(H5F_addr_defined(fh_addr)); + + /* Look up the fractal heap header */ + if(NULL == (hdr = H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, NULL, NULL, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, 0, "unable to load fractal heap header") + + /* Return direct block free space */ + ret_value = hdr->man_dtable.row_dblock_free[row]; + +done: + /* Release fractal heap header node */ + if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, 0, "unable to release fractal heap header info") + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5HF_get_dblock_free_test() */ + |