BipedalLocomotion::TestUtils::MemoryAllocationMonitor class

Public static functions

static auto monitorIsEnabled() -> bool
Get if the the memory monitor is actually enabled at the compilation level.
static void startMonitor()
Start monitoring the memory operations.
static void endMonitor()
Stop monitoring the memory operations.
static auto checkNoMemoryAllocationInLastMonitor() -> bool
Check if any memory operation was performed during the last monitor.
static auto endMonitorAndCheckNoMemoryAllocationInLastMonitor() -> bool
Equivalent to calling endMonitor() and checkNoMemoryAllocationInLastMonitor() in sequence.
static auto getNumberOfDynamicMemoryOperationsInLastMonitor() -> int32_t
Return the number of memory operations performed during the last monitor.

Function documentation

static bool BipedalLocomotion::TestUtils::MemoryAllocationMonitor::monitorIsEnabled()

Get if the the memory monitor is actually enabled at the compilation level.

Returns True if the the memory monitor is enabled, false otherwise.

The monitor can be enabled (just on Linux) with the FRAMEWORK_RUN_MemoryAllocationMonitor_tests CMake variable

static void BipedalLocomotion::TestUtils::MemoryAllocationMonitor::startMonitor()

Start monitoring the memory operations.

This will reset all the memory operaton counters.

static void BipedalLocomotion::TestUtils::MemoryAllocationMonitor::endMonitor()

Stop monitoring the memory operations.

This will stop any counting of memory operations.

static bool BipedalLocomotion::TestUtils::MemoryAllocationMonitor::checkNoMemoryAllocationInLastMonitor()

Check if any memory operation was performed during the last monitor.

Returns True if no memory operation were performed between the startMonitor and endMonitor calls, false otherwise.

static bool BipedalLocomotion::TestUtils::MemoryAllocationMonitor::endMonitorAndCheckNoMemoryAllocationInLastMonitor()

Equivalent to calling endMonitor() and checkNoMemoryAllocationInLastMonitor() in sequence.

Returns True if no memory operation were performed between the startMonitor and endMonitor calls, false otherwise.

static int32_t BipedalLocomotion::TestUtils::MemoryAllocationMonitor::getNumberOfDynamicMemoryOperationsInLastMonitor()

Return the number of memory operations performed during the last monitor.

Returns Return the number of memory operations were performed between the startMonitor and endMonitor calls.