Add max_item_size() to etl::ipool (#1001)

This commit is contained in:
rolandreichweinbmw 2024-12-26 14:15:14 +01:00 committed by GitHub
parent 99d7537506
commit f0ebf26b6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -271,6 +271,14 @@ namespace etl
return Max_Size;
}
//*************************************************************************
/// Returns the maximum size of an item in the pool.
//*************************************************************************
size_t max_item_size() const
{
return Item_Size;
}
//*************************************************************************
/// Returns the maximum number of items in the pool.
//*************************************************************************

View File

@ -288,6 +288,14 @@ namespace
CHECK(pool.max_size() == 4U);
}
//*************************************************************************
TEST(test_max_item_size)
{
etl::pool<Test_Data, 4> pool;
CHECK(pool.max_item_size() == sizeof(Test_Data));
}
//*************************************************************************
TEST(test_size)
{