diff --git a/src/ripple/shamap/SHAMapInnerNode.h b/src/ripple/shamap/SHAMapInnerNode.h index 43328eb6b..db7244e70 100644 --- a/src/ripple/shamap/SHAMapInnerNode.h +++ b/src/ripple/shamap/SHAMapInnerNode.h @@ -103,7 +103,7 @@ private: public: explicit SHAMapInnerNode( std::uint32_t cowid, - std::uint8_t numAllocatedChildren = branchFactor); + std::uint8_t numAllocatedChildren = 2); SHAMapInnerNode(SHAMapInnerNode const&) = delete; SHAMapInnerNode& diff --git a/src/ripple/shamap/impl/TaggedPointer.ipp b/src/ripple/shamap/impl/TaggedPointer.ipp index c97b7433e..62e43cfe0 100644 --- a/src/ripple/shamap/impl/TaggedPointer.ipp +++ b/src/ripple/shamap/impl/TaggedPointer.ipp @@ -23,18 +23,7 @@ #include -// #define FORCE_BOOST_POOL 1 -#if FORCE_BOOST_POOL || !__has_include() -#define USE_BOOST_POOL 1 -#else -#define USE_BOOST_POOL 0 -#endif - -#if USE_BOOST_POOL #include -#else -#include -#endif namespace ripple { @@ -102,8 +91,6 @@ boundariesIndex(std::uint8_t numChildren) std::lower_bound(boundaries.begin(), boundaries.end(), numChildren)); } -#if USE_BOOST_POOL - template std::array, boundaries.size()> initAllocateArrayFuns( std::index_sequence) @@ -171,38 +158,6 @@ deallocateArrays(std::uint8_t boundaryIndex, void* p) assert(isFromArrayFuns[boundaryIndex](p)); freeArrayFuns[boundaryIndex](p); } -#else - -template -std::array - initPmrArrayFuns(std::index_sequence) -{ - return std::array{ - std::pmr::synchronized_pool_resource{std::pmr::pool_options{ - /* max_blocks_per_chunk */ chunksPerBlock[I], - /* largest_required_pool_block */ chunksPerBlock[I]}}..., - }; -} -std::array - pmrArrayFuns = - initPmrArrayFuns(std::make_index_sequence{}); - -// This function returns an untagged pointer -[[nodiscard]] inline std::pair -allocateArrays(std::uint8_t numChildren) -{ - auto const i = boundariesIndex(numChildren); - return {i, pmrArrayFuns[i].allocate(arrayChunkSizeBytes[i])}; -} - -// This function takes an untagged pointer -inline void -deallocateArrays(std::uint8_t boundaryIndex, void* p) -{ - return pmrArrayFuns[boundaryIndex].deallocate( - p, arrayChunkSizeBytes[boundaryIndex]); -} -#endif [[nodiscard]] inline int popcnt16(std::uint16_t a)