Rishka
RISC-V virtual runtime in C/C++ made for ESP32-WROVER
|
Class for handling memory management operations in Rishka applications. More...
#include <memory.h>
Static Public Member Functions | |
static void | initialize () |
static any | alloc (usize size) |
Allocate memory. More... | |
static any | calloc (usize num, usize size) |
Allocate and clear memory. More... | |
static any | realloc (any ptr, usize size) |
Reallocate memory. More... | |
static void | free (any ptr) |
Free memory. More... | |
static any | set (any dest, u8 c, usize n) |
Set memory values. More... | |
Class for handling memory management operations in Rishka applications.
The Memory class provides static methods for allocating, reallocating, and freeing memory, as well as functions for setting memory values on ESP32-WROVER microcontrollers.
Allocate memory.
This method allocates a block of memory of the specified size.
size | The size of the memory block to allocate in bytes. |
Allocate and clear memory.
This method allocates a block of memory of the specified size and initializes it to zero.
dest | Pointer to the destination memory block. |
num | The number of elements in the memory block. |
size | The size of each element in bytes. |
|
static |
Free memory.
This method frees the memory block previously allocated by alloc, calloc, or realloc.
ptr | Pointer to the memory block to free. |
Reallocate memory.
This method reallocates a block of memory to the specified size.
dest | Pointer to the destination memory block. |
ptr | Pointer to the previously allocated memory block. |
size | The new size of the memory block in bytes. |
Set memory values.
This method sets the first n bytes of the memory block pointed to by dest to the specified value.
dest | Pointer to the destination memory block. |
c | The value to set. |
n | The number of bytes to set. |