Memory module implementation file. More...
Go to the source code of this file.
Functions | |
void * | memory_allocate (mcl_size_t bytes, const char *function, unsigned line) |
void * | memory_allocate_with_zero (mcl_size_t count, mcl_size_t bytes, const char *function, unsigned line) |
void * | memory_reallocate (void *p, mcl_size_t bytes, const char *function, unsigned line) |
void | memory_release (void *p, const char *function, unsigned line) |
void * | memory_malloc (mcl_size_t size) |
malloc wrapper More... | |
void * | memory_calloc (mcl_size_t count, mcl_size_t bytes) |
calloc wrapper More... | |
void * | memory_realloc (void *p, mcl_size_t bytes) |
realloc wrapper More... | |
void | memory_free (void *p) |
free wrapper More... | |
Memory module implementation file.
Definition in file memory.c.
void* memory_allocate | ( | mcl_size_t | bytes, |
const char * | function, | ||
unsigned | line | ||
) |
This function is called to allocate memory.
bytes | Size of the space to be allocated. |
function | The name of the calling function. Gathered with FUNCTION macro. |
line | The line of the calling function. Gathered with LINE macro. |
Definition at line 22 of file memory.c.
References ASSERT_MESSAGE, MCL_NULL, MCL_VERBOSE, memory_malloc(), VERBOSE_ENTRY, and VERBOSE_LEAVE.
void* memory_allocate_with_zero | ( | mcl_size_t | count, |
mcl_size_t | bytes, | ||
const char * | function, | ||
unsigned | line | ||
) |
This function is called to allocate memory and initialize it with zero.
count | Count of the object to be created. Total memory space will be (count* |
bytes | Size of the space to be allocated. |
function | The name of the calling function. Gathered with FUNCTION macro. |
line | The line of the calling function. Gathered with LINE macro. |
Definition at line 39 of file memory.c.
References ASSERT_MESSAGE, MCL_VERBOSE, memory_calloc(), VERBOSE_ENTRY, and VERBOSE_LEAVE.
void* memory_calloc | ( | mcl_size_t | count, |
mcl_size_t | bytes | ||
) |
calloc wrapper
If stddef.h is exists in the system it uses the calloc function. If another implementation will be needed it can be added.
count | Count of the object to be created. Total memory space will be (count* |
bytes | Size of the space to be allocated. |
Definition at line 109 of file memory.c.
References VERBOSE_ENTRY, and VERBOSE_LEAVE.
Referenced by http_client_initialize(), and memory_allocate_with_zero().
void memory_free | ( | void * | p | ) |
free wrapper
If stddef.h is exists in the system it uses the free function. If another implementation will be needed it can be added.
p | The pointer to be freed. |
Definition at line 129 of file memory.c.
References MCL_VERBOSE, VERBOSE_ENTRY, and VERBOSE_LEAVE.
Referenced by _libcrypto_free(), http_client_initialize(), json_util_initialize_json_library(), and memory_release().
void* memory_malloc | ( | mcl_size_t | size | ) |
malloc wrapper
If stddef.h is exists it uses the malloc function. If another implementation will be needed it can be added.
size | Size of the space to be allocated. |
Definition at line 99 of file memory.c.
References VERBOSE_ENTRY, and VERBOSE_LEAVE.
Referenced by _libcrypto_malloc(), http_client_initialize(), json_util_initialize_json_library(), and memory_allocate().
void* memory_realloc | ( | void * | p, |
mcl_size_t | bytes | ||
) |
realloc wrapper
If stddef.h is exists in the system it uses the realloc function. If another implementation will be needed it can be added.
p | The pointer to be reallocated. |
bytes | Size of the space to be allocated. |
Definition at line 119 of file memory.c.
References VERBOSE_ENTRY, and VERBOSE_LEAVE.
Referenced by _libcrypto_realloc(), http_client_initialize(), and memory_reallocate().
void* memory_reallocate | ( | void * | p, |
mcl_size_t | bytes, | ||
const char * | function, | ||
unsigned | line | ||
) |
This function is called to reallocate memory.
p | The pointer to be reallocated. |
bytes | Size of the space to be allocated. |
function | The name of the calling function. Gathered with FUNCTION macro. |
line | The line of the calling function. Gathered with LINE macro. |
Definition at line 57 of file memory.c.
References ASSERT_MESSAGE, MCL_FREE, MCL_NULL, MCL_VERBOSE, memory_realloc(), VERBOSE_ENTRY, and VERBOSE_LEAVE.
void memory_release | ( | void * | p, |
const char * | function, | ||
unsigned | line | ||
) |
This function is called to free memory.
p | The pointer to be freed. |
function | The name of the calling function. Gathered with FUNCTION macro. |
line | The line of the calling function. Gathered with LINE macro. |
Definition at line 83 of file memory.c.
References MCL_NULL, MCL_VERBOSE, memory_free(), VERBOSE_ENTRY, and VERBOSE_LEAVE.