From 90048700babce26be192daf0234943275dd58b22 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Mon, 12 Apr 2021 12:13:55 +0200 Subject: [PATCH] Fixed compilation error on linux target after addition of memory profiling functions --- openrtx/src/memory_profiling.cpp | 44 +++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/openrtx/src/memory_profiling.cpp b/openrtx/src/memory_profiling.cpp index 2b0609e3..973a6711 100644 --- a/openrtx/src/memory_profiling.cpp +++ b/openrtx/src/memory_profiling.cpp @@ -18,9 +18,12 @@ * along with this program; if not, see * ***************************************************************************/ -#include #include +#ifdef _MIOSIX + +#include + /* * Provide a C-callable wrapper for the corresponding miosix functions. */ @@ -60,3 +63,42 @@ unsigned int getCurrentFreeHeap() //return miosix::MemoryProfiling::getCurrentFreeHeap(); return getAbsoluteFreeHeap(); } + +#else + +/* + * No memory profiling is possible on x86/64 machines, thus all the functions + * return 0. + */ + +unsigned int getStackSize() +{ + return 0; +} + +unsigned int getAbsoluteFreeStack() +{ + return 0; +} + +unsigned int getCurrentFreeStack() +{ + return 0; +} + +unsigned int getHeapSize() +{ + return 0; +} + +unsigned int getAbsoluteFreeHeap() +{ + return 0; +} + +unsigned int getCurrentFreeHeap() +{ + return 0; +} + +#endif