/* * heap_stats.hpp * * Created on: Nov 21, 2023 * Author: Dario */ #ifndef RTOS_DEBUG_HEAP_STATS_HPP #define RTOS_DEBUG_HEAP_STATS_HPP #include #ifdef STA_DEBUGGING_ENABLED #include namespace sta { namespace rtos { /** * @brief Get the free memory on the heap. * * @return size_t The number of free bytes on the heap. */ size_t getAvailableHeapSpace(); /** * @brief Get the total number of allocs during the program's * runtime. * * @return size_t The number of allocs. */ size_t getNumAllocs(); /** * @brief Get the total number of frees during the program's * runtime. * * @return size_t The number of frees. */ size_t getNumFrees(); /** * @brief Print the current heap stats * */ void printHeapStats(); } // namespace rtos } // namespace sta /** * @brief Print the current heap stats. */ # define STA_DEBUG_HEAP_STATS() sta::rtos::printHeapStats() #else # define STA_DEBUG_HEAP_STATS() ((void)0) #endif // STA_DEBUGGING_ENABLED #endif /* RTOS_DEBUG_HEAP_STATS_HPP */