wickr-crypto-c
Functions
memory management functions

Functions

void * wickr_alloc (size_t len)
 
void * wickr_alloc_zero (size_t len)
 
void wickr_free (void *buf)
 
void wickr_free_zero (void *buf, size_t len)
 

Detailed Description

Function Documentation

◆ wickr_alloc()

void* wickr_alloc ( size_t  len)

Allocate memory from the system

Parameters
lenthe number of bytes to allocate
Returns
a pointer to 'len' bytes of newly allocated memory, or NULL if the underlying system allocation fails

◆ wickr_alloc_zero()

void* wickr_alloc_zero ( size_t  len)

Allocate zeroed memory from the system

Parameters
lenthe number of bytes of zeroed memory to allocate
Returns
a pointer to 'len' bytes of newly allocated memory filled with 0s, or NULL if the underlying system allocation fails

◆ wickr_free()

void wickr_free ( void *  buf)

Free memory

Parameters
bufthe pointer to memory that needs to be freed

◆ wickr_free_zero()

void wickr_free_zero ( void *  buf,
size_t  len 
)

Zero-then-free memory

Parameters
bufthe buffer to fill with 0s and then free
lenthe number of bytes to fill with 0s before freeing 'buf'