Fixed compilation error on linux target after addition of memory profiling functions

This commit is contained in:
Silvano Seva 2021-04-12 12:13:55 +02:00
parent 60defbedc0
commit 90048700ba
1 changed files with 43 additions and 1 deletions

View File

@ -18,9 +18,12 @@
* along with this program; if not, see <http://www.gnu.org/licenses/> * * along with this program; if not, see <http://www.gnu.org/licenses/> *
***************************************************************************/ ***************************************************************************/
#include <miosix.h>
#include <memory_profiling.h> #include <memory_profiling.h>
#ifdef _MIOSIX
#include <miosix.h>
/* /*
* Provide a C-callable wrapper for the corresponding miosix functions. * Provide a C-callable wrapper for the corresponding miosix functions.
*/ */
@ -60,3 +63,42 @@ unsigned int getCurrentFreeHeap()
//return miosix::MemoryProfiling::getCurrentFreeHeap(); //return miosix::MemoryProfiling::getCurrentFreeHeap();
return getAbsoluteFreeHeap(); 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