Skip to content

Commit 3f526cf

Browse files
committed
Fix compilation errors
1 parent 174d5e4 commit 3f526cf

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

include/libpmr/new.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ class LIBIMP_EXPORT block_collector {
2828
virtual void recycle(void *p, std::size_t bytes, std::size_t alignment) noexcept = 0;
2929
};
3030

31+
#if defined(LIBIMP_CPP_17)
3132
using get_block_collector_t = block_collector *(*)() noexcept;
33+
#else
34+
using get_block_collector_t = block_collector *(*)();
35+
#endif
3236

3337
static constexpr std::size_t regular_head_size
3438
= ::LIBIMP::round_up(sizeof(get_block_collector_t), alignof(std::max_align_t));
@@ -123,12 +127,12 @@ class block_pool_resource : public block_resource_base<BlockSize, BlockPoolExpan
123127
/// \brief Different increment levels match different chunk sizes.
124128
/// 512 means that 512 consecutive memory blocks are allocated at a time, and the block size is N.
125129
template <std::size_t L>
126-
constexpr static std::size_t block_pool_expansion = 0;
130+
constexpr std::size_t block_pool_expansion = 0;
127131

128-
template <> constexpr static std::size_t block_pool_expansion<0> = 512;
129-
template <> constexpr static std::size_t block_pool_expansion<1> = 256;
130-
template <> constexpr static std::size_t block_pool_expansion<2> = 128;
131-
template <> constexpr static std::size_t block_pool_expansion<3> = 64;
132+
template <> constexpr std::size_t block_pool_expansion<0> = 512;
133+
template <> constexpr std::size_t block_pool_expansion<1> = 256;
134+
template <> constexpr std::size_t block_pool_expansion<2> = 128;
135+
template <> constexpr std::size_t block_pool_expansion<3> = 64;
132136

133137
/// \brief Match the appropriate memory block resources according to the size of the specification.
134138
template <std::size_t N, std::size_t L = regular_level(N)>

0 commit comments

Comments
 (0)