diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-07-06 19:45:35 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-07-06 19:45:35 (GMT) |
commit | 98754fa9d12090f5e048fdb05cc5e9ce9111676f (patch) | |
tree | 407e611b19ee551d8153779104022dd886a467e5 /src/H5Tvlen.c | |
parent | 29321bcafa9f1c6108bb92b5a844a9d4d9c2c8e7 (diff) | |
download | hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.zip hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.gz hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.bz2 |
[svn-r19050] Description:
Bring r18704:19049 from trunk to revise_chunks branch.
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-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5Tvlen.c')
-rw-r--r-- | src/H5Tvlen.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 8a6ee05..95f4086 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -1303,3 +1303,44 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_vlen_get_alloc_info() */ + +/*------------------------------------------------------------------------- + * Function: H5T_vlen_reclaim_elmt + * + * Purpose: Alternative method to reclaim any VL data for a buffer element. + * + * Use this function when the datatype is already available, but + * the allocation info is needed from the dxpl_id before jumping + * into recursion. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mike McGreevy + * May 11, 2010 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id) +{ + H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ + H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ + herr_t ret_value = SUCCEED; /* return value */ + + HDassert(dt); + HDassert(elem); + + FUNC_ENTER_NOAPI(H5T_vlen_reclaim_elmt, FAIL) + + /* Get VL allocation info */ + if (H5T_vlen_get_alloc_info(dxpl_id, &vl_alloc_info) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") + + /* Recurse on buffer to free dynamic fields */ + ret_value = H5T_vlen_reclaim_recurse(elem,dt,vl_alloc_info->free_func,vl_alloc_info->free_info); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5T_vlen_reclaim_elmt */ |