From fa929322ab7eed7ae4998d9d5c248951eb9026a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 7 Dec 2017 19:46:37 +0100 Subject: [PATCH] load_mon: remove usage of CONFIG_RAM_SIZE The define should not be used, as it might be wrong. This is the case on fmu-v5, which meant that the used RAM was always 1. --- src/modules/load_mon/load_mon.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/load_mon/load_mon.cpp b/src/modules/load_mon/load_mon.cpp index 4939b5ac0e..df756f9d72 100644 --- a/src/modules/load_mon/load_mon.cpp +++ b/src/modules/load_mon/load_mon.cpp @@ -246,14 +246,7 @@ float LoadMon::_ram_used() // mem.fordblks: free (bytes) // mem.mxordblk: largest remaining block (bytes) - float load = (float)mem.uordblks / mem.arena; - - // Check for corruption of the allocation counters - if ((mem.arena > CONFIG_RAM_SIZE) || (mem.fordblks > CONFIG_RAM_SIZE)) { - load = 1.0f; - } - - return load; + return (float)mem.uordblks / mem.arena; #else return 0.0f; #endif