lv_mem.h
API reference for lv_mem.h
Functions
lv_mem_init
Initialize to use malloc/free/realloc etc
void lv_mem_init(void)lv_mem_deinit
Drop all dynamically allocated memory and reset the memory pools' state
void lv_mem_deinit(void)lv_mem_add_pool
lv_mem_pool_t lv_mem_add_pool(void *mem, size_t bytes)| Name | Type |
|---|---|
mem | void * |
bytes | size_t |
lv_mem_remove_pool
void lv_mem_remove_pool(lv_mem_pool_t pool)| Name | Type |
|---|---|
pool | lv_mem_pool_t |
lv_malloc
Allocate memory dynamically
void * lv_malloc(size_t size)| Name | Type | Description |
|---|---|---|
size | size_t | requested size in bytes |
Returns: void * — pointer to allocated uninitialized memory, or NULL on failure
lv_calloc
Allocate a block of zeroed memory dynamically
void * lv_calloc(size_t num, size_t size)| Name | Type | Description |
|---|---|---|
num | size_t | requested number of element to be allocated. |
size | size_t | requested size of each element in bytes. |
Returns: void * — pointer to allocated zeroed memory, or NULL on failure
lv_zalloc
Allocate zeroed memory dynamically
void * lv_zalloc(size_t size)| Name | Type | Description |
|---|---|---|
size | size_t | requested size in bytes |
Returns: void * — pointer to allocated zeroed memory, or NULL on failure
lv_malloc_zeroed
Allocate zeroed memory dynamically
void * lv_malloc_zeroed(size_t size)| Name | Type | Description |
|---|---|---|
size | size_t | requested size in bytes |
Returns: void * — pointer to allocated zeroed memory, or NULL on failure
lv_free
Free an allocated data
void lv_free(void *data)| Name | Type | Description |
|---|---|---|
data | void * | pointer to an allocated memory |
lv_realloc
Reallocate a memory with a new size. The old content will be kept.
void * lv_realloc(void *data_p, size_t new_size)| Name | Type | Description |
|---|---|---|
data_p | void * | pointer to an allocated memory. Its content will be copied to the new memory block and freed |
new_size | size_t | the desired new size in byte |
Returns: void * — pointer to the new memory, NULL on failure
lv_reallocf
Reallocate a memory with a new size. The old content will be kept. In case of failure, the old pointer is free'd.
void * lv_reallocf(void *data_p, size_t new_size)| Name | Type | Description |
|---|---|---|
data_p | void * | pointer to an allocated memory. Its content will be copied to the new memory block and freed |
new_size | size_t | the desired new size in byte |
Returns: void * — pointer to the new memory, NULL on failure
lv_malloc_core
Used internally to execute a plain malloc operation
void * lv_malloc_core(size_t size)| Name | Type | Description |
|---|---|---|
size | size_t | size in bytes to malloc |
lv_free_core
Used internally to execute a plain free operation
void lv_free_core(void *p)| Name | Type | Description |
|---|---|---|
p | void * | memory address to free |
lv_realloc_core
Used internally to execute a plain realloc operation
void * lv_realloc_core(void *p, size_t new_size)| Name | Type | Description |
|---|---|---|
p | void * | memory address to realloc |
new_size | size_t | size in bytes to realloc |
lv_mem_monitor_core
Used internally by lv_mem_monitor() to gather LVGL heap state information.
void lv_mem_monitor_core(lv_mem_monitor_t *mon_p)| Name | Type | Description |
|---|---|---|
mon_p | lv_mem_monitor_t * | pointer to lv_mem_monitor_t object to be populated. |
lv_mem_test_core
lv_result_t lv_mem_test_core(void)lv_mem_test
Tests the memory allocation system by allocating and freeing a block of memory.
lv_result_t lv_mem_test(void)Returns: lv_result_t — LV_RESULT_OK if the memory allocation system is working properly, or LV_RESULT_INVALID if there is an error.
lv_mem_monitor
Give information about the work memory of dynamic allocation
void lv_mem_monitor(lv_mem_monitor_t *mon_p)| Name | Type | Description |
|---|---|---|
mon_p | lv_mem_monitor_t * | pointer to a lv_mem_monitor_t variable, the result of the analysis will be stored here |
Structs
lv_mem_monitor_t
Heap information structure.
Used by 2 functions
lv_mem_monitor_core— parammon_plv_mem_monitor— parammon_p
Typedefs
lv_mem_pool_t
typedef void* lv_mem_pool_tUsed by 1 function
lv_mem_remove_pool— parampool
Dependencies
How is this guide?
Last updated on