wip
This commit is contained in:
parent
058c26e39a
commit
c5aae5148e
@ -20,7 +20,8 @@ using ContractorHeap = util::QueryHeap<NodeID,
|
||||
NodeID,
|
||||
EdgeWeight,
|
||||
ContractorHeapData,
|
||||
util::XORFastHashStorage<NodeID, NodeID>>;
|
||||
util::XORFastHashStorage<NodeID, NodeID>,
|
||||
false>;
|
||||
|
||||
} // namespace osrm::contractor
|
||||
|
||||
|
@ -23,13 +23,12 @@ class MemoryManager
|
||||
public:
|
||||
static MemoryManager &instance()
|
||||
{
|
||||
thread_local MemoryManager instance;
|
||||
static thread_local MemoryManager instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
T *allocate(std::size_t n)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
size_t free_list_index = get_next_power_of_two_exponent(n);
|
||||
auto &free_list = free_lists_[free_list_index];
|
||||
const auto items_in_block = 1u << free_list_index;
|
||||
@ -52,7 +51,6 @@ public:
|
||||
|
||||
void deallocate(T *p, std::size_t n) noexcept
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
size_t free_list_index = get_next_power_of_two_exponent(n);
|
||||
free_lists_[free_list_index].push_back(p);
|
||||
}
|
||||
@ -66,8 +64,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
std::mutex mutex_;
|
||||
|
||||
MemoryManager() = default;
|
||||
MemoryManager(const MemoryManager &) = delete;
|
||||
MemoryManager &operator=(const MemoryManager &) = delete;
|
||||
|
Loading…
Reference in New Issue
Block a user