Skip to content

Commit 6412ef4

Browse files
frankistcodebot
authored andcommitted
adt: fix concurrent byte buffer pool unit tests
1 parent d6b4454 commit 6412ef4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/srsran/support/memory_pool/fixed_size_memory_block_pool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class fixed_size_memory_block_pool
6666
nof_blocks(nof_blocks_),
6767
max_local_batches(
6868
std::max(std::min((size_t)MAX_LOCAL_BATCH_CAPACITY, static_cast<size_t>(nof_blocks / block_batch_size / 32U)),
69-
static_cast<size_t>(1U)))
69+
static_cast<size_t>(2U)))
7070
{
7171
srsran_assert(nof_blocks > max_local_cache_size(),
7272
"The number of segments in the pool must be much larger than the thread cache size ({} <= {})",

tests/unittests/support/fixed_size_memory_pool_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ TEST(fixed_memory_block_pool_test, correct_instantiation)
1919
{
2020
struct test_tag_id {};
2121

22-
auto& pool = fixed_size_memory_block_pool<test_tag_id, true>::get_instance(32, 256);
23-
ASSERT_EQ(pool.nof_memory_blocks(), 32);
22+
auto& pool = fixed_size_memory_block_pool<test_tag_id, true>::get_instance(128, 256);
23+
ASSERT_EQ(pool.nof_memory_blocks(), 128);
2424
ASSERT_EQ(pool.memory_block_size(), 256);
2525
pool.print_all_buffers();
2626
}
2727

2828
TEST(fixed_memory_block_pool_test, allocated_block_is_valid)
2929
{
3030
struct test_tag_id {};
31-
auto& pool = fixed_size_memory_block_pool<test_tag_id, true>::get_instance(32, 256);
31+
auto& pool = fixed_size_memory_block_pool<test_tag_id, true>::get_instance(128, 256);
3232
void* block = pool.allocate_node(256);
3333
ASSERT_NE(block, nullptr);
3434
pool.deallocate_node(block);
@@ -37,7 +37,7 @@ TEST(fixed_memory_block_pool_test, allocated_block_is_valid)
3737
TEST(fixed_memory_block_pool_test, number_of_alloc_blocks_matches_pool_size)
3838
{
3939
struct test_tag_id {};
40-
auto& pool = fixed_size_memory_block_pool<test_tag_id, true>::get_instance(32, 256);
40+
auto& pool = fixed_size_memory_block_pool<test_tag_id, true>::get_instance(128, 256);
4141

4242
std::vector<void*> blocks;
4343

0 commit comments

Comments
 (0)