Skip to content

Commit

Permalink
Added allocators to visited and path cache
Browse files Browse the repository at this point in the history
  • Loading branch information
JoBuRo committed Oct 15, 2024
1 parent bc4732f commit dd76bdb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/engine/PathSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "PathSearch.h"

#include <algorithm>
#include <functional>
#include <iterator>
#include <optional>
#include <ranges>
Expand All @@ -14,6 +15,7 @@
#include "engine/CallFixedSize.h"
#include "engine/QueryExecutionTree.h"
#include "engine/VariableToColumnMap.h"
#include "util/AllocatorWithLimit.h"

using namespace pathSearch;

Expand Down Expand Up @@ -305,9 +307,14 @@ PathsLimited PathSearch::findPaths(const Id& source,
const BinSearchWrapper& binSearch) const {
std::vector<Edge> edgeStack;
Path currentPath{EdgesLimited(allocator())};
std::unordered_map<uint64_t, std::vector<Path>> pathCache;
std::unordered_map<
uint64_t, PathsLimited, std::hash<uint64_t>, std::equal_to<uint64_t>,
ad_utility::AllocatorWithLimit<std::pair<const uint64_t, PathsLimited>>>
pathCache{allocator()};
PathsLimited result{allocator()};
std::unordered_set<uint64_t> visited;
std::unordered_set<uint64_t, std::hash<uint64_t>, std::equal_to<uint64_t>,
ad_utility::AllocatorWithLimit<uint64_t>>
visited{allocator()};

visited.insert(source.getBits());
for (auto edge : binSearch.outgoingEdes(source)) {
Expand Down

0 comments on commit dd76bdb

Please sign in to comment.