Skip to content

Commit

Permalink
fix all path memory tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Jul 6, 2023
1 parent 7509e6d commit dbb903d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/graph/executor/algo/AllPathsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ folly::Future<std::vector<AllPathsExecutor::NPath*>> AllPathsExecutor::doBuildPa
size_t end,
std::shared_ptr<std::vector<NPath*>> pathsPtr,
bool reverse) {
memory::MemoryCheckGuard guard;
auto maxStep = reverse ? rightSteps_ : leftSteps_;
if (step > maxStep) {
return folly::makeFuture<std::vector<NPath*>>(std::vector<NPath*>());
Expand Down Expand Up @@ -333,7 +334,6 @@ folly::Future<std::vector<AllPathsExecutor::NPath*>> AllPathsExecutor::doBuildPa
}
return folly::collect(futures).via(runner()).thenValue(
[currentStepResult = newPathsPtr](std::vector<std::vector<NPath*>>&& paths) {
memory::MemoryCheckGuard guard;
std::vector<NPath*> result = std::move(*currentStepResult);
for (auto& path : paths) {
if (path.empty()) {
Expand Down Expand Up @@ -458,6 +458,7 @@ std::vector<Row> AllPathsExecutor::buildOneWayPathFromHashTable(bool reverse) {

folly::Future<Status> AllPathsExecutor::conjunctPath(std::vector<NPath*>& leftPaths,
std::vector<NPath*>& rightPaths) {
memory::MemoryCheckGuard guard;
if (leftPaths.empty() || rightPaths.empty()) {
return folly::makeFuture<Status>(Status::OK());
}
Expand Down Expand Up @@ -487,7 +488,6 @@ folly::Future<Status> AllPathsExecutor::conjunctPath(std::vector<NPath*>& leftPa
}
return folly::collect(futures).via(runner()).thenValue(
[this, path = std::move(oneWayPath)](std::vector<std::vector<Row>>&& resps) {
memory::MemoryCheckGuard guard;
result_.rows = std::move(path);
for (auto& rows : resps) {
if (rows.empty()) {
Expand Down Expand Up @@ -528,6 +528,7 @@ void AllPathsExecutor::buildHashTable(std::vector<NPath*>& paths, bool reverse)
}

std::vector<Row> AllPathsExecutor::probe(size_t start, size_t end, bool reverse) {
memory::MemoryCheckGuard guard;
auto buildPath = [](std::vector<Value>& leftPath,
const Value& intersectVertex,
std::vector<Value>& rightPath) {
Expand Down

0 comments on commit dbb903d

Please sign in to comment.