Speedup SD card & enlarge your RAM. (#1649)
* FuriHal: sram2 memory manager * FuriHal: sram2 memory allocator * FuriHal: allow NULL buffers for txrx in spi hal * SD card: sector cache * FuriHal: fix init in memory hal * RPC: STARTUP instead SERVICE * Memory: pool "free" command * Thread: service can be statically allocated in a memory pool Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "memmgr.h"
|
||||
#include "common_defines.h"
|
||||
#include <string.h>
|
||||
#include <furi_hal_memory.h>
|
||||
|
||||
extern void* pvPortMalloc(size_t xSize);
|
||||
extern void vPortFree(void* pv);
|
||||
@@ -77,3 +78,18 @@ void* __wrap__realloc_r(struct _reent* r, void* ptr, size_t size) {
|
||||
UNUSED(r);
|
||||
return realloc(ptr, size);
|
||||
}
|
||||
|
||||
void* memmgr_alloc_from_pool(size_t size) {
|
||||
void* p = furi_hal_memory_alloc(size);
|
||||
if(p == NULL) p = malloc(size);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
size_t memmgr_pool_get_free(void) {
|
||||
return furi_hal_memory_get_free();
|
||||
}
|
||||
|
||||
size_t memmgr_pool_get_max_block(void) {
|
||||
return furi_hal_memory_max_pool_block();
|
||||
}
|
||||
Reference in New Issue
Block a user