Skip to content

Commit f0ebf26

Browse files
Add max_item_size() to etl::ipool (#1001)
1 parent 99d7537 commit f0ebf26

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

include/etl/ipool.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@ namespace etl
271271
return Max_Size;
272272
}
273273

274+
//*************************************************************************
275+
/// Returns the maximum size of an item in the pool.
276+
//*************************************************************************
277+
size_t max_item_size() const
278+
{
279+
return Item_Size;
280+
}
281+
274282
//*************************************************************************
275283
/// Returns the maximum number of items in the pool.
276284
//*************************************************************************

test/test_pool.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,14 @@ namespace
288288
CHECK(pool.max_size() == 4U);
289289
}
290290

291+
//*************************************************************************
292+
TEST(test_max_item_size)
293+
{
294+
etl::pool<Test_Data, 4> pool;
295+
296+
CHECK(pool.max_item_size() == sizeof(Test_Data));
297+
}
298+
291299
//*************************************************************************
292300
TEST(test_size)
293301
{

0 commit comments

Comments
 (0)