mirror of
https://github.com/ratspeak/microReticulum
synced 2026-11-27 13:52:14 +00:00
WIP: Logging optimizations and memory management
Changed a few key logs to use printf-style instead of string concatenation to avoid dynamic memory allocation. Still need to move all remaining logging over to printf-style. Added option (-DRNS_USE_ALLOCATOR=1) to override new/delete operators for both allocation metrics and the ability to implement an alternate memory allocator. Added option (-DRNS_USE_TLSF=1) to use the alternate TLSF allocator (must also define RNS_USE_ALLOCATOR). This allocator is well known for reducing fragmentation and providing constant, O(1)-time allocation and deallocation for real-time embedded systems. This TLSF allocator appears to already be the default allocator for ESP32 boards, but the allocator used by NRF52 is unknown at this time so the TLSF allocator internal to microReticulum is only being used for NRF52 boards at this time. Future memory management improvements will include custom allocators for long-lived structures like the path table that will segregate them from the general pool of memory that is constantly cycling, thereby further reducing fragmentation. It will also allow these structures to use alternate memory like PSRAM present on T-Beam boards.
This commit is contained in:
1 parent
25741cf235
commit
3af5111606
30 files changed
+2428
-355
No files matched your search
+6
-1
@@ -85,14 +85,19 @@ namespace RNS { namespace Type {
|
||||
// CBA TEST
|
||||
static const uint16_t CLEAN_INTERVAL = 60*15;
|
||||
//static const uint16_t CLEAN_INTERVAL = 60;
|
||||
// CBA TEST
|
||||
// CBA MCU
|
||||
//static const uint16_t PERSIST_INTERVAL = 60*60*12;
|
||||
// CBA TEST
|
||||
static const uint16_t PERSIST_INTERVAL = 60*60;
|
||||
//static const uint16_t PERSIST_INTERVAL = 60;
|
||||
static const uint16_t GRACIOUS_PERSIST_INTERVAL = 60*5;
|
||||
|
||||
static const uint8_t DESTINATION_LENGTH = TRUNCATED_HASHLENGTH/8; // In bytes
|
||||
|
||||
// CBA MCU
|
||||
//static const uint8_t FILEPATH_MAXSIZE = 64;
|
||||
static const uint8_t FILEPATH_MAXSIZE = 96;
|
||||
|
||||
}
|
||||
|
||||
namespace Identity {
|
||||
|
||||
Reference in new issue
Block a user