mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-12 02:36:00 +00:00
48 lines
589 B
C++
48 lines
589 B
C++
/*
|
|
* heap_stats.cpp
|
|
*
|
|
* Created on: Nov 21, 2023
|
|
* Author: Dario
|
|
*/
|
|
|
|
#include <sta/rtos/debug/heap_stats.hpp>
|
|
|
|
#ifdef STA_DEBUGGING_ENABLED_NP
|
|
|
|
#include <FreeRTOS.h>
|
|
#include <cmsis_os2.h>
|
|
|
|
|
|
namespace sta
|
|
{
|
|
namespace rtos
|
|
{
|
|
size_t getAvailableHeapSpace()
|
|
{
|
|
return stats.xAvailableHeapSpaceInBytes;
|
|
}
|
|
|
|
size_t getNumAllocs()
|
|
{
|
|
|
|
return stats.xNumberOfSuccessfulAllocations;
|
|
}
|
|
|
|
size_t getNumFrees()
|
|
{
|
|
|
|
return stats.xNumberOfSuccessfulFrees;
|
|
}
|
|
|
|
void printHeapStats()
|
|
{
|
|
|
|
}
|
|
} // namespace rtos
|
|
} // namespace sta
|
|
|
|
#endif // STA_DEBUGGING_ENABLED
|
|
|
|
|
|
|