TLSF memory allocator. Less free flash, moar free ram. (#3572)

* add tlsf as submodule
* libs: tlsf
* Furi: tlsf as allocator
* Furi: heap walker
* shmal fixshesh
* f18: tlsf
* PVS: ignore tlsf
* I like to moving
* merge upcoming changes
* memmgr: alloc aligned, realloc
* Furi: distinct name for auxiliary memory pool
* Furi: put idle and timer thread to mem2
* Furi: fix smal things in allocator
* Furi: remove aligned_free. Use free instead.
* aligned_malloc -> aligned_alloc
* aligned_alloc, parameters order
* aligned_alloc: check that alignment is correct
* unit test: malloc
* unit tests: realloc and test with memory fragmentation
* unit tests: aligned_alloc
* update api
* updater: properly read large update file

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Sergei Gavrilov
2024-05-16 01:47:21 +10:00
committed by MX
parent 6d1a5c71e6
commit 5dddb075ac
21 changed files with 628 additions and 645 deletions

View File

@@ -36,37 +36,22 @@ 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
* @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 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
* @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 pool free memory size
*
* @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
*/