Skip to content

Commit

Permalink
Add max_item_size() to etl::ipool
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandreichweinbmw committed Dec 24, 2024
1 parent 99d7537 commit c1e274b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/etl/ipool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//*************************************************************************
Expand Down
8 changes: 8 additions & 0 deletions test/test_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit c1e274b

Please sign in to comment.