diff --git a/include/etl/ipool.h b/include/etl/ipool.h index ce4c317e0..88e03e46f 100644 --- a/include/etl/ipool.h +++ b/include/etl/ipool.h @@ -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. //************************************************************************* diff --git a/test/test_pool.cpp b/test/test_pool.cpp index 48f2881ab..2866ab1d0 100644 --- a/test/test_pool.cpp +++ b/test/test_pool.cpp @@ -288,6 +288,14 @@ namespace CHECK(pool.max_size() == 4U); } + //************************************************************************* + TEST(test_max_item_size) + { + etl::pool pool; + + CHECK(pool.max_item_size() == sizeof(Test_Data)); + } + //************************************************************************* TEST(test_size) {