Skip to content

Commit

Permalink
Fix C++17 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrisudell authored and tommaisey committed Feb 7, 2024
1 parent b547654 commit a4f1201
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions include/realtime_memory/memory_resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,7 @@ namespace detail
inline std::size_t mono_default_nextbuf_size = 32 * sizeof(void*);
inline std::size_t max_u32 = (std::size_t) std::numeric_limits<std::uint32_t>::max();

inline pool_options default_pool_options = {
.max_blocks_per_chunk = std::size_t (1 << 15),
.largest_required_pool_block = 4096
};
inline pool_options default_pool_options = {std::size_t (1 << 15), 4096};

// Note: Undefined behaviour if 'align' is not a power of two!
constexpr std::size_t aligned_ceil (size_t size, size_t align) noexcept
Expand Down
7 changes: 2 additions & 5 deletions tests/resource_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,7 @@ TEST_CASE ("unsynchronized_pool_resource", "[memory_resource]")
const auto largestBlock = GENERATE (as<size_t>(), 32ul, 1 << 15, max_u64 - 1);
CAPTURE (maxBlocks, largestBlock);

pmr::pool_options options {
.max_blocks_per_chunk = maxBlocks,
.largest_required_pool_block = largestBlock
};
pmr::pool_options options {maxBlocks, largestBlock};
pmr::unsynchronized_pool_resource pool (options, nullptr);

const auto expectedLargestBlock = std::min (largestBlock, max_u32);
Expand Down Expand Up @@ -424,7 +421,7 @@ TEST_CASE ("free_list_resource", "[memory_resource]")
{}

// Return all the blocks except one in the middle.
// We do this in random order, to ensure the the free list must be sorted.
// We do this in random order, to ensure the free list must be sorted.
const auto middlePtr = ptrs[ptrs.size() / 2];
const auto seed = Catch::Generators::Detail::getSeed();
std::shuffle (ptrs.begin(), ptrs.end(), std::default_random_engine (seed));
Expand Down

0 comments on commit a4f1201

Please sign in to comment.