mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-08-06 11:07:34 +00:00
Asserts on free and alloc
This commit is contained in:
@@ -26,13 +26,16 @@ namespace sta
|
||||
template <typename T>
|
||||
void * RtosMemPool<T>::alloc(uint32_t timeout /* = osWaitForever */)
|
||||
{
|
||||
return osMemoryPoolAlloc(handle_, timeout);
|
||||
void * addr = osMemoryPoolAlloc(handle_, timeout)
|
||||
STA_ASSERT_MSG(addr != nullptr, "Failed to Alloc RtosMemPool Block");
|
||||
return addr;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
osStatus_t RtosMemPool<T>::free(void * block)
|
||||
void RtosMemPool<T>::free(void * block)
|
||||
{
|
||||
return osMemoryPoolFree(handle_, block);
|
||||
STA_ASSERT_MSG(osMemoryPoolFree(handle_, block) == osOK,
|
||||
"Failed to Free RtosMemPool Block");
|
||||
}
|
||||
} // namespace sta
|
||||
|
||||
|
Reference in New Issue
Block a user