_h5_calloc added
This commit is contained in:
@@ -8,7 +8,8 @@ void *
|
||||
_h5_alloc (
|
||||
h5_file_t * const f,
|
||||
void *ptr,
|
||||
const size_t size ) {
|
||||
const size_t size
|
||||
) {
|
||||
h5_debug ( f, "Allocating %ld bytes.", size );
|
||||
ptr = realloc ( ptr, size );
|
||||
if ( ptr == NULL ) {
|
||||
@@ -21,6 +22,24 @@ _h5_alloc (
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void *
|
||||
_h5_calloc (
|
||||
h5_file_t * const f,
|
||||
const size_t count,
|
||||
const size_t size
|
||||
) {
|
||||
h5_debug ( f, "Allocating %ld * %ld bytes.", count, size );
|
||||
void *ptr = calloc ( count, size );
|
||||
if ( ptr == NULL ) {
|
||||
h5_error (
|
||||
f,
|
||||
H5_ERR_NOMEM,
|
||||
"Out of memory." );
|
||||
return (void*)(H5_ERR);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
_h5_free (
|
||||
h5_file_t * const f,
|
||||
|
||||
@@ -8,6 +8,13 @@ _h5_alloc (
|
||||
const size_t size
|
||||
);
|
||||
|
||||
void *
|
||||
_h5_calloc (
|
||||
h5_file_t * const f,
|
||||
const size_t count,
|
||||
const size_t size
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
_h5_free (
|
||||
h5_file_t * const f,
|
||||
|
||||
Reference in New Issue
Block a user