mcl_memory.h File Reference

Memory module interface header file. More...

Include dependency graph for mcl_memory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MCL_MALLOC(bytes)   mcl_memory_malloc(bytes)
 
#define MCL_NEW(p)   ((p) = MCL_MALLOC((long)sizeof (*p)))
 
#define MCL_CALLOC(count, bytes)   mcl_memory_calloc(count, bytes)
 
#define MCL_NEW_WITH_ZERO(p)   ((p) = MCL_CALLOC(1, (long)sizeof *(p)))
 
#define MCL_RESIZE(p, bytes)   ((p) = mcl_memory_realloc(p, bytes))
 
#define MCL_FREE(p)   ((void)(mcl_memory_free(p), (p) = NULL))
 

Functions

MCL_CORE_EXPORT void * mcl_memory_malloc (mcl_size_t size)
 
MCL_CORE_EXPORT void * mcl_memory_calloc (mcl_size_t count, mcl_size_t bytes)
 
MCL_CORE_EXPORT void * mcl_memory_realloc (void *p, mcl_size_t bytes)
 
MCL_CORE_EXPORT void mcl_memory_free (void *p)
 

Detailed Description

Memory module interface header file.

This module contains functions and macro definitions for memory allocation/deallocation operations.

Definition in file mcl_memory.h.

Macro Definition Documentation

#define MCL_CALLOC (   count,
  bytes 
)    mcl_memory_calloc(count, bytes)
#define MCL_FREE (   p)    ((void)(mcl_memory_free(p), (p) = NULL))
#define MCL_NEW_WITH_ZERO (   p)    ((p) = MCL_CALLOC(1, (long)sizeof *(p)))

Definition at line 57 of file mcl_memory.h.

#define MCL_RESIZE (   p,
  bytes 
)    ((p) = mcl_memory_realloc(p, bytes))

Definition at line 58 of file mcl_memory.h.

Referenced by _response_payload_callback(), and get_chunked_response().

Function Documentation

MCL_CORE_EXPORT void* mcl_memory_calloc ( mcl_size_t  count,
mcl_size_t  bytes 
)

This function allocates memory and sets it to zero.

Parameters
countNumber of elements to be allocated. Total memory allocated will be (count*bytes)
bytesSize of each element in bytes.
Returns
Pointer to the allocated memory.

Definition at line 24 of file memory.c.

Referenced by mcl_http_client_initialize().

Here is the caller graph for this function:

MCL_CORE_EXPORT void mcl_memory_free ( void *  p)

This function frees memory.

Parameters
pPointer to the memory to be freed.

Definition at line 45 of file memory.c.

Referenced by _libcrypto_free(), json_util_initialize_json_library(), and mcl_http_client_initialize().

Here is the caller graph for this function:

MCL_CORE_EXPORT void* mcl_memory_malloc ( mcl_size_t  size)

This function allocates memory.

Parameters
sizeSize of the memory to be allocated in bytes.
Returns
Pointer to the allocated memory.

Definition at line 14 of file memory.c.

Referenced by _libcrypto_malloc(), json_util_initialize_json_library(), and mcl_http_client_initialize().

Here is the caller graph for this function:

MCL_CORE_EXPORT void* mcl_memory_realloc ( void *  p,
mcl_size_t  bytes 
)

This function reallocates memory.

Parameters
pPointer to the memory to be reallocated.
bytesSize of the memory to be reallocated in bytes.
Returns
Pointer to the reallocated memory.

Definition at line 34 of file memory.c.

Referenced by _libcrypto_realloc(), and mcl_http_client_initialize().

Here is the caller graph for this function: