void * H5allocate_memory(
size_t size,
hbool_t clear
)
H5allocate_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.
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). |
NULL if size is 0
(zero).
NULL on failure.| Release | Change |
| 1.8.15 | C function introduced with this release. |