feat(f4): more free memory on handsets with CCM RAM (#5804)

Alternative Lua memory allocator for radios with CCM RAM - primarily GX12 at present
This commit is contained in:
philmoz
2025-01-20 10:32:20 +10:00
committed by GitHub
parent a3c0e0a007
commit a6542e1448
10 changed files with 251 additions and 29 deletions
+3 -3
View File
@@ -76,6 +76,7 @@
#if defined(LUA)
#include "lua/lua_states.h"
#include "lua/custom_allocator.h"
#endif
RadioData g_eeGeneral;
@@ -1891,9 +1892,8 @@ uint32_t availableMemory()
struct mallinfo info = mallinfo();
#if defined(USE_BIN_ALLOCATOR)
extern int bin_avail();
return ((uint32_t)((unsigned char *)&_heap_end - heap)) + info.fordblks + bin_avail();
#if defined(USE_CUSTOM_ALLOCATOR)
return ((uint32_t)((unsigned char *)&_heap_end - heap)) + info.fordblks + custom_avail();
#else
return ((uint32_t)((unsigned char *)&_heap_end - heap)) + info.fordblks;
#endif