@@ -124,7 +124,7 @@ template <typename NodeID, typename Key> class UnorderedMapStorage
124124 private:
125125 template <typename K, typename V>
126126 using UnorderedMap = std::
127- unordered_map<K, V, std::hash<K>, std::equal_to<K>, PoolAllocator<std::pair<const K, V>>>;
127+ unordered_map<K, V/* , std::hash<K>, std::equal_to<K>, PoolAllocator<std::pair<const K, V>>*/ >;
128128
129129 UnorderedMap<NodeID, Key> nodes;
130130};
@@ -241,7 +241,8 @@ template <typename NodeID,
241241 typename Key,
242242 typename Weight,
243243 typename Data,
244- typename IndexStorage = ArrayStorage<NodeID, NodeID>>
244+ typename IndexStorage = ArrayStorage<NodeID, NodeID>,
245+ bool ThreadLocal = true >
245246class QueryHeap
246247{
247248 private:
@@ -259,11 +260,17 @@ class QueryHeap
259260 return weight > other.weight ;
260261 }
261262 };
263+
264+ using AllocatorType = typename std::conditional<ThreadLocal,
265+ PoolAllocator<HeapData>,
266+ std::allocator<HeapData>>::type;
267+
268+
262269 using HeapContainer = boost::heap::d_ary_heap<HeapData,
263270 boost::heap::arity<4 >,
264271 boost::heap::mutable_<true >,
265272 boost::heap::compare<std::greater<HeapData>>,
266- boost::heap::allocator<PoolAllocator<HeapData> >>;
273+ boost::heap::allocator<AllocatorType >>;
267274 using HeapHandle = typename HeapContainer::handle_type;
268275
269276 public:
0 commit comments