Allocates memory that will later be freed internally by the HDF5 library
Procedure:
H5_ALLOCATE_MEMORY(size, clear)
Signature:
void *H5allocate_memory
(
size_t size,
hbool_t clear
)
Parameters:
size_t
size | IN: Specifies the size in bytes of the buffer to be allocated |
hbool_t clear | IN: Specifies whether the new buffer is to be initialized to 0 (zero) |
Description:
H5_ALLOCATE_MEMORY allocates a memory buffer of size bytes that will later be freed internally by the HDF5 library.
The boolean clear
parameter specifies whether the buffer should be initialized. If clear
is TRUE
, all bits in the buffer are to be set to 0
(zero); if clear
is FALSE
, the buffer will not be initialized.
This function is intended to have the semantics of malloc()
and calloc()
. However, unlike malloc()
and calloc()
which allow for a “special” pointer to be returned instead of NULL
, this function always returns NULL
on failure or when size
is set to 0
(zero).
At this time, the only intended use for this function is to allocate memory that will be returned to the library as a data buffer from a third-party filter.
Returns:
On success, returns pointer to newly allocated buffer or returns NULL
if size
is 0
(zero).
Returns NULL
on failure.
Example:
See Also:
History:
Release | Change |
---|
1.8.15 | C function introduced with this release. |
--- Last Modified: July 28, 2020 | 10:12 AM