H5Pset_vlen_mem_manager(hid_t plist,
H5MM_allocate_t alloc,
void *alloc_info,
H5MM_free_t free,
void *free_info
)
H5Dread and H5Dvlen_reclaim.
H5Pset_vlen_mem_manager sets the memory manager for
variable-length datatype allocation in H5Dread
and free in H5Dvlen_reclaim.
The alloc and free parameters
identify the memory management routines to be used.
If the user has defined custom memory management routines,
alloc and/or free should be set to make
those routine calls (i.e., the name of the routine is used as
the value of the parameter);
if the user prefers to use the system's malloc
and/or free, the alloc and
free parameters, respectively, should be set to
NULL
The prototypes for these user-defined functions would appear as follows:
typedef void *(*H5MM_allocate_t)(size_t size,
void *alloc_info) ;
typedef void (*H5MM_free_t)(void *mem,
void *free_info) ;
The alloc_info and free_info parameters
can be used to pass along any required information to
the user's memory management routines.
In summary, if the user has defined custom memory management
routines, the name(s) of the routines are passed in the
alloc and free parameters and the
custom routines' parameters are passed in the
alloc_info and free_info parameters.
If the user wishes to use the system malloc and
free functions, the alloc and/or
free parameters are set to NULL
and the alloc_info and free_info
parameters are ignored.
hid_t plist |
IN: Identifier for the dataset transfer property list. |
H5MM_allocate_t alloc |
IN: User's allocate routine, or NULL
for system malloc. |
void *alloc_info |
IN: Extra parameter for user's allocation routine.
Contents are ignored if preceding parameter is NULL. |
H5MM_free_t free |
IN: User's free routine, or NULL
for system free. |
void *free_info |
IN: Extra parameter for user's free routine.
Contents are ignored if preceding parameter is NULL. |