Merge branch 'pull-request/#1001-Add-max_item_size()-to-etl-ipool' into development

This commit is contained in:
John Wellbelove 2024-12-26 13:24:21 +00:00
commit 3d43922845
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)
{