All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups

Detailed Description

Standard memory functions.

Function Documentation

void * calloc ( size_t  count,
size_t  size 
)

Allocates space for count objects that are size bytes and fills the memory with bytes of value 0.

Parameters
countThe number of objects to allocate space for
sizeThe size of the object type being allocated
Returns
A pointer to the allocated memory or NULL on error.
void free ( void *  ptr)

Frees previously allocated memory.

Parameters
ptrThe memory buffer to free.
void * malloc ( size_t  size)

Allocates a requested amount of memory.

Parameters
sizeThe number of bytes to allocate
Returns
A pointer to the allocated memory or NULL on error.
void * memcpy ( void *  dest,
const void *  src,
size_t  n 
)

Copies n bytes from src to dest.

Parameters
destThe pointer to the destination memory region
srcThe pointer to the source memory region
nThe number of bytes to copy
void * memmove ( void *  dest,
const void *  src,
size_t  n 
)

Copies n bytes from src to dest by first copying to a temporary area first, allowing dest and src to potentially overlap.

This can be used to move data to a location that overlaps its previous location.

Parameters
destThe pointer to the destination memory region
srcThe pointer to the source memory region
nThe number of bytes to copy
void * memset ( void *  dest,
int  c,
size_t  n 
)

Sets n bytes to c starting at dest.

This can be used to clear a memory region for example if c is 0.

Parameters
destThe pointer to the destination memory region
cThe integer used as an unsigned char to assign to each byte
nThe number of bytes to set
void * realloc ( void *  ptr,
size_t  size 
)

Takes the memory allocated at ptr and changes the length of its allocation to the size specified.

Copies the smaller of the length of the original allocation or the new size into the newly allocated buffer.

Parameters
ptrThe memory allocation to be changed
sizeThe size to change the ptr allocation to
Returns
A pointer to the new allocated memory or NULL on error

Typedef Documentation

size as an unsigned integer