diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-11-16 20:45:05 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-11-16 20:45:05 (GMT) |
commit | d2b87ec47ebdb096c331c7b62a195b9cea2f33ae (patch) | |
tree | a066f01361afaf5df457cef612bb0bb9fd80fe18 /src/H5MFdbg.c | |
parent | ee5a1e07350f0dcf3ef07d9443aa2f4c073392f4 (diff) | |
download | hdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.zip hdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.tar.gz hdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.tar.bz2 |
[svn-r17896] Description:
Bring r17546:17895 from trunk to revise_chunks branch. Changes to
fixed and extensible array dataset chunk indexing code to accommodate changes
to private APIs in those interfaces. Also, other adjustments to source code
and expected output in response to changes on the trunk.
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 (smirom) 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
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5MFdbg.c')
-rw-r--r-- | src/H5MFdbg.c | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index ca87c83..31cff15 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -41,7 +41,6 @@ #include "H5Fpkg.h" /* File access */ #include "H5MFpkg.h" /* File memory management */ -#ifdef H5MF_ALLOC_DEBUG_DUMP /****************/ /* Local Macros */ @@ -139,6 +138,67 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF_sects_debug_cb() */ + +/*------------------------------------------------------------------------- + * Function: H5MF_sects_debug + * + * Purpose: Iterate over free space sections for a file + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * January 31 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int indent, int fwidth) +{ + herr_t ret_value = SUCCEED; /* Return value */ + H5FD_mem_t type; /* Memory type for iteration */ + + FUNC_ENTER_NOAPI(H5MF_sects_debug, FAIL) + + /* + * Check arguments. + */ + HDassert(f); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); + + for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) + if(H5F_addr_eq(f->shared->fs_addr[type], fs_addr)) { + if(!f->shared->fs_man[type]) + if(H5MF_alloc_open(f, dxpl_id, type) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") + + if(f->shared->fs_man[type]) { + H5MF_debug_iter_ud_t udata; /* User data for callbacks */ + + /* Prepare user data for section iteration callback */ + udata.fspace = f->shared->fs_man[type]; + udata.stream = stream; + udata.indent = indent; + udata.fwidth = fwidth; + + /* Iterate over all the free space sections */ + if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") + + /* Close the free space information */ + if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") + } /* end if */ + break; + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5MF_sects_debug() */ + +#ifdef H5MF_ALLOC_DEBUG_DUMP /*------------------------------------------------------------------------- * Function: H5MF_sects_dump |