mirror of
https://github.com/ratspeak/microReticulum
synced 2026-11-27 13:52:14 +00:00
Major bug fixes and performance enhancements
- Fixed bug in path table loading from flash storage wherein the raw (packed) announce packet associated with each path entry was not being unpacked prior to use. - Fixed bug in path table entry announce packet loading where critical changes to the announce packet (like hops increment) was being overwriteen each time packet was re-loaded from cache. - Optimized path table entries to lazy-load both announce packet and receive interface so that memory is consumed by these structures until if/when the path is actually used. - Updated several global timers and sizes to match new RNS 1.x values. - Bumped version to 0.2.9
This commit is contained in:
1 parent
a968fdfc64
commit
49ccbc2827
16 files changed
+361
-304
No files matched your search
+3
-13
@@ -205,7 +205,7 @@ Can be used to load previously created and saved identities into Reticulum.
|
||||
cull_known_destinations();
|
||||
}
|
||||
catch (const std::bad_alloc&) {
|
||||
ERRORF("remember: bad_alloc - out of memory, identity not stored for %s", destination_hash.toHex().c_str());
|
||||
ERRORF("remember: bad_alloc - OUT OF MEMORY, identity not stored for %s", destination_hash.toHex().c_str());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
ERRORF("remember: exception storing identity: %s", e.what());
|
||||
@@ -319,19 +319,9 @@ Recall last heard app_data for a destination hash.
|
||||
file = open(RNS.Reticulum.storagepath+"/known_destinations","wb")
|
||||
umsgpack.dump(Identity.known_destinations, file)
|
||||
file.close()
|
||||
DEBUGF("Saved known destinations to storage in %.3f seconds", OS::round(OS::time() - save_start, 3));
|
||||
*/
|
||||
|
||||
std::string time_str;
|
||||
double save_time = OS::time() - save_start;
|
||||
if (save_time < 1) {
|
||||
time_str = std::to_string((int)(save_time*1000)) + " ms";
|
||||
}
|
||||
else {
|
||||
time_str = std::to_string(OS::round(save_time, 1)) + " s";
|
||||
}
|
||||
|
||||
DEBUGF("Saved known destinations to storage in %s", time_str.c_str());
|
||||
|
||||
success = true;
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
@@ -394,7 +384,7 @@ Recall last heard app_data for a destination hash.
|
||||
DEBUGF("Removed %d path(s) from known destinations", count);
|
||||
}
|
||||
catch (const std::bad_alloc& e) {
|
||||
ERROR("cull_known_destinations: bad_alloc - out of memory building sort index, falling back to single erase");
|
||||
ERROR("cull_known_destinations: bad_alloc - OUT OF MEMORY building sort index, falling back to single erase");
|
||||
// Fallback: std::min_element does no heap allocation — erase one oldest entry
|
||||
auto oldest = std::min_element(
|
||||
_known_destinations.begin(), _known_destinations.end(),
|
||||
|
||||
Reference in new issue
Block a user