hollyhock
|
Functions used for modifying and allocating memory. More...
#include <stdint.h>
Go to the source code of this file.
Functions | |
void | free (void *ptr) |
void * | malloc (uint32_t size) |
void * | memcpy (void *destination, const void *source, int num) |
void * | memset (void *ptr, int value, int num) |
Functions used for modifying and allocating memory.
Similar to the memory functions provided by the C standard library.
void free | ( | void * | ptr | ) |
Frees memory allocated by malloc, allowing it to be reused.
ptr | The pointer to the allocated region of memory to free. |
void* malloc | ( | uint32_t | size | ) |
Allocates size
bytes of memory.
The current application crashes if the memory cannot be allocated.
size | The number of bytes of memory to allocate. |
void* memcpy | ( | void * | destination, |
const void * | source, | ||
int | num | ||
) |
Copies one region of memory to another. Equivalent to the C standard library function with the same name.
Copies num
bytes from source
to destination
.
[out] | destination | A pointer to the destination of the copy. |
[in] | source | A pointer to the source for the copy. |
num | The number of bytes to copy. |
destination
void* memset | ( | void * | ptr, |
int | value, | ||
int | num | ||
) |
Sets a region of memory to a specific value. Equivalent to the C standard library function with the same name.
Fills the region pointed to by ptr
with num
bytes of value value
(zero-extended to a byte).
[out] | ptr | A pointer to the region of memory to fill. |
value | The value to fill the memory region with. | |
num | The number of bytes to fill. |
ptr