From 5bca6d2e842625c234a114d0a8db2fc7a9c178aa Mon Sep 17 00:00:00 2001 From: SG Date: Tue, 9 Apr 2024 15:23:46 +0300 Subject: [PATCH] Furi: remove aligned_free. Use free instead. --- furi/core/memmgr.c | 4 ---- furi/core/memmgr.h | 11 ++--------- lib/flipper_application/elf/elf_file.c | 6 +++--- targets/f18/api_symbols.csv | 3 +-- targets/f7/api_symbols.csv | 3 +-- 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/furi/core/memmgr.c b/furi/core/memmgr.c index 5785bff6e..bb1040343 100644 --- a/furi/core/memmgr.c +++ b/furi/core/memmgr.c @@ -42,10 +42,6 @@ void* aligned_malloc(size_t size, size_t alignment) { return pvPortAllocAligned(size, alignment); } -void aligned_free(void* p) { - vPortFree(p); -} - size_t memmgr_get_free_heap(void) { return xPortGetFreeHeapSize(); } diff --git a/furi/core/memmgr.h b/furi/core/memmgr.h index 7a3f7b8f3..d38633118 100644 --- a/furi/core/memmgr.h +++ b/furi/core/memmgr.h @@ -36,20 +36,13 @@ size_t memmgr_get_total_heap(void); size_t memmgr_get_minimum_free_heap(void); /** - * An aligned version of malloc, used when you need to get the aligned space on the heap - * Freeing the received address is performed ONLY through the aligned_free function + * An aligned version of malloc, used when you need to get the aligned space on the heap. * @param size * @param alignment * @return void* */ void* aligned_malloc(size_t size, size_t alignment); -/** - * Freed space obtained through the aligned_malloc function - * @param p pointer to result of aligned_malloc - */ -void aligned_free(void* p); - /** * @brief Allocate memory from the auxiliary memory pool. That memory can't be freed. * @@ -59,7 +52,7 @@ void aligned_free(void* p); void* memmgr_aux_pool_alloc(size_t size); /** - * @brief Get the auxiliary poll free memory size + * @brief Get the auxiliary pool free memory size * * @return size_t */ diff --git a/lib/flipper_application/elf/elf_file.c b/lib/flipper_application/elf/elf_file.c index 654316866..4d36f3460 100644 --- a/lib/flipper_application/elf/elf_file.c +++ b/lib/flipper_application/elf/elf_file.c @@ -713,7 +713,7 @@ static bool elf_relocate_fast(ELFFile* elf, ELFSection* s) { } } - aligned_free(s->fast_rel->data); + free(s->fast_rel->data); free(s->fast_rel); s->fast_rel = NULL; @@ -780,10 +780,10 @@ void elf_file_free(ELFFile* elf) { ELFSectionDict_next(it)) { const ELFSectionDict_itref_t* itref = ELFSectionDict_cref(it); if(itref->value.data) { - aligned_free(itref->value.data); + free(itref->value.data); } if(itref->value.fast_rel) { - aligned_free(itref->value.fast_rel->data); + free(itref->value.fast_rel->data); free(itref->value.fast_rel); } free((void*)itref->key); diff --git a/targets/f18/api_symbols.csv b/targets/f18/api_symbols.csv index d1beda897..ea4d997ac 100644 --- a/targets/f18/api_symbols.csv +++ b/targets/f18/api_symbols.csv @@ -1,5 +1,5 @@ entry,status,name,type,params -Version,+,61.1,, +Version,+,62.0,, Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli_vcp.h,, @@ -515,7 +515,6 @@ Function,-,acoshf,float,float Function,-,acoshl,long double,long double Function,-,acosl,long double,long double Function,-,aligned_alloc,void*,"size_t, size_t" -Function,+,aligned_free,void,void* Function,+,aligned_malloc,void*,"size_t, size_t" Function,-,arc4random,__uint32_t, Function,-,arc4random_buf,void,"void*, size_t" diff --git a/targets/f7/api_symbols.csv b/targets/f7/api_symbols.csv index 291e57b27..cf1eb642d 100644 --- a/targets/f7/api_symbols.csv +++ b/targets/f7/api_symbols.csv @@ -1,5 +1,5 @@ entry,status,name,type,params -Version,+,61.1,, +Version,+,62.0,, Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,, Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/cli/cli.h,, @@ -584,7 +584,6 @@ Function,-,acoshf,float,float Function,-,acoshl,long double,long double Function,-,acosl,long double,long double Function,-,aligned_alloc,void*,"size_t, size_t" -Function,+,aligned_free,void,void* Function,+,aligned_malloc,void*,"size_t, size_t" Function,-,arc4random,__uint32_t, Function,-,arc4random_buf,void,"void*, size_t"