mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 03:48:35 -07:00
Furi: distinct name for auxiliary memory pool
This commit is contained in:
@@ -425,8 +425,8 @@ void cli_command_free(Cli* cli, FuriString* args, void* context) {
|
|||||||
printf("Minimum heap size: %zu\r\n", memmgr_get_minimum_free_heap());
|
printf("Minimum heap size: %zu\r\n", memmgr_get_minimum_free_heap());
|
||||||
printf("Maximum heap block: %zu\r\n", memmgr_heap_get_max_free_block());
|
printf("Maximum heap block: %zu\r\n", memmgr_heap_get_max_free_block());
|
||||||
|
|
||||||
printf("Pool free: %zu\r\n", memmgr_pool_get_free());
|
printf("Aux pool total free: %zu\r\n", memmgr_aux_pool_get_free());
|
||||||
printf("Maximum pool block: %zu\r\n", memmgr_pool_get_max_block());
|
printf("Aux pool max free block: %zu\r\n", memmgr_pool_get_max_block());
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -78,14 +78,14 @@ void* __wrap__realloc_r(struct _reent* r, void* ptr, size_t size) {
|
|||||||
return realloc(ptr, size);
|
return realloc(ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* memmgr_alloc_from_pool(size_t size) {
|
void* memmgr_aux_pool_alloc(size_t size) {
|
||||||
void* p = furi_hal_memory_alloc(size);
|
void* p = furi_hal_memory_alloc(size);
|
||||||
if(p == NULL) p = malloc(size);
|
if(p == NULL) p = malloc(size);
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t memmgr_pool_get_free(void) {
|
size_t memmgr_aux_pool_get_free(void) {
|
||||||
return furi_hal_memory_get_free();
|
return furi_hal_memory_get_free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,22 +51,22 @@ void* aligned_malloc(size_t size, size_t alignment);
|
|||||||
void aligned_free(void* p);
|
void aligned_free(void* p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Allocate memory from separate memory pool. That memory can't be freed.
|
* @brief Allocate memory from the auxiliary memory pool. That memory can't be freed.
|
||||||
*
|
*
|
||||||
* @param size
|
* @param size
|
||||||
* @return void*
|
* @return void*
|
||||||
*/
|
*/
|
||||||
void* memmgr_alloc_from_pool(size_t size);
|
void* memmgr_aux_pool_alloc(size_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get free memory pool size
|
* @brief Get the auxiliary poll free memory size
|
||||||
*
|
*
|
||||||
* @return size_t
|
* @return size_t
|
||||||
*/
|
*/
|
||||||
size_t memmgr_pool_get_free(void);
|
size_t memmgr_aux_pool_get_free(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get max free block size from memory pool
|
* @brief Get max free block size from the auxiliary memory pool
|
||||||
*
|
*
|
||||||
* @return size_t
|
* @return size_t
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -276,8 +276,8 @@ void furi_thread_start(FuriThread* thread) {
|
|||||||
stack,
|
stack,
|
||||||
thread,
|
thread,
|
||||||
priority,
|
priority,
|
||||||
memmgr_alloc_from_pool(sizeof(StackType_t) * stack),
|
memmgr_aux_pool_alloc(sizeof(StackType_t) * stack),
|
||||||
memmgr_alloc_from_pool(sizeof(StaticTask_t)));
|
memmgr_aux_pool_alloc(sizeof(StaticTask_t)));
|
||||||
} else {
|
} else {
|
||||||
BaseType_t ret = xTaskCreate(
|
BaseType_t ret = xTaskCreate(
|
||||||
furi_thread_body, thread->name, stack, thread, priority, &thread->task_handle);
|
furi_thread_body, thread->name, stack, thread, priority, &thread->task_handle);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
entry,status,name,type,params
|
entry,status,name,type,params
|
||||||
Version,+,61.0,,
|
Version,+,61.1,,
|
||||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||||
Header,+,applications/services/cli/cli.h,,
|
Header,+,applications/services/cli/cli.h,,
|
||||||
Header,+,applications/services/cli/cli_vcp.h,,
|
Header,+,applications/services/cli/cli_vcp.h,,
|
||||||
@@ -1972,7 +1972,8 @@ Function,+,memchr,void*,"const void*, int, size_t"
|
|||||||
Function,+,memcmp,int,"const void*, const void*, size_t"
|
Function,+,memcmp,int,"const void*, const void*, size_t"
|
||||||
Function,+,memcpy,void*,"void*, const void*, size_t"
|
Function,+,memcpy,void*,"void*, const void*, size_t"
|
||||||
Function,-,memmem,void*,"const void*, size_t, const void*, size_t"
|
Function,-,memmem,void*,"const void*, size_t, const void*, size_t"
|
||||||
Function,-,memmgr_alloc_from_pool,void*,size_t
|
Function,-,memmgr_aux_pool_alloc,void*,size_t
|
||||||
|
Function,-,memmgr_aux_pool_get_free,size_t,
|
||||||
Function,+,memmgr_get_free_heap,size_t,
|
Function,+,memmgr_get_free_heap,size_t,
|
||||||
Function,+,memmgr_get_minimum_free_heap,size_t,
|
Function,+,memmgr_get_minimum_free_heap,size_t,
|
||||||
Function,+,memmgr_get_total_heap,size_t,
|
Function,+,memmgr_get_total_heap,size_t,
|
||||||
@@ -1981,7 +1982,6 @@ Function,+,memmgr_heap_enable_thread_trace,void,FuriThreadId
|
|||||||
Function,+,memmgr_heap_get_max_free_block,size_t,
|
Function,+,memmgr_heap_get_max_free_block,size_t,
|
||||||
Function,+,memmgr_heap_get_thread_memory,size_t,FuriThreadId
|
Function,+,memmgr_heap_get_thread_memory,size_t,FuriThreadId
|
||||||
Function,+,memmgr_heap_walk_blocks,void,"BlockWalker, void*"
|
Function,+,memmgr_heap_walk_blocks,void,"BlockWalker, void*"
|
||||||
Function,-,memmgr_pool_get_free,size_t,
|
|
||||||
Function,-,memmgr_pool_get_max_block,size_t,
|
Function,-,memmgr_pool_get_max_block,size_t,
|
||||||
Function,+,memmove,void*,"void*, const void*, size_t"
|
Function,+,memmove,void*,"void*, const void*, size_t"
|
||||||
Function,-,mempcpy,void*,"void*, const void*, size_t"
|
Function,-,mempcpy,void*,"void*, const void*, size_t"
|
||||||
|
|||||||
|
@@ -1,5 +1,5 @@
|
|||||||
entry,status,name,type,params
|
entry,status,name,type,params
|
||||||
Version,+,61.0,,
|
Version,+,61.1,,
|
||||||
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
||||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||||
Header,+,applications/services/cli/cli.h,,
|
Header,+,applications/services/cli/cli.h,,
|
||||||
@@ -2363,7 +2363,8 @@ Function,+,memchr,void*,"const void*, int, size_t"
|
|||||||
Function,+,memcmp,int,"const void*, const void*, size_t"
|
Function,+,memcmp,int,"const void*, const void*, size_t"
|
||||||
Function,+,memcpy,void*,"void*, const void*, size_t"
|
Function,+,memcpy,void*,"void*, const void*, size_t"
|
||||||
Function,-,memmem,void*,"const void*, size_t, const void*, size_t"
|
Function,-,memmem,void*,"const void*, size_t, const void*, size_t"
|
||||||
Function,-,memmgr_alloc_from_pool,void*,size_t
|
Function,-,memmgr_aux_pool_alloc,void*,size_t
|
||||||
|
Function,-,memmgr_aux_pool_get_free,size_t,
|
||||||
Function,+,memmgr_get_free_heap,size_t,
|
Function,+,memmgr_get_free_heap,size_t,
|
||||||
Function,+,memmgr_get_minimum_free_heap,size_t,
|
Function,+,memmgr_get_minimum_free_heap,size_t,
|
||||||
Function,+,memmgr_get_total_heap,size_t,
|
Function,+,memmgr_get_total_heap,size_t,
|
||||||
@@ -2372,7 +2373,6 @@ Function,+,memmgr_heap_enable_thread_trace,void,FuriThreadId
|
|||||||
Function,+,memmgr_heap_get_max_free_block,size_t,
|
Function,+,memmgr_heap_get_max_free_block,size_t,
|
||||||
Function,+,memmgr_heap_get_thread_memory,size_t,FuriThreadId
|
Function,+,memmgr_heap_get_thread_memory,size_t,FuriThreadId
|
||||||
Function,+,memmgr_heap_walk_blocks,void,"BlockWalker, void*"
|
Function,+,memmgr_heap_walk_blocks,void,"BlockWalker, void*"
|
||||||
Function,-,memmgr_pool_get_free,size_t,
|
|
||||||
Function,-,memmgr_pool_get_max_block,size_t,
|
Function,-,memmgr_pool_get_max_block,size_t,
|
||||||
Function,+,memmove,void*,"void*, const void*, size_t"
|
Function,+,memmove,void*,"void*, const void*, size_t"
|
||||||
Function,-,mempcpy,void*,"void*, const void*, size_t"
|
Function,-,mempcpy,void*,"void*, const void*, size_t"
|
||||||
|
|||||||
|
@@ -19,7 +19,7 @@ static SectorCache* cache = NULL;
|
|||||||
|
|
||||||
void sector_cache_init(void) {
|
void sector_cache_init(void) {
|
||||||
if(cache == NULL) {
|
if(cache == NULL) {
|
||||||
cache = memmgr_alloc_from_pool(sizeof(SectorCache));
|
cache = memmgr_aux_pool_alloc(sizeof(SectorCache));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cache != NULL) {
|
if(cache != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user