aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-08-30 19:01:30 +0200
committereldritch horrors <pennae@lix.systems>2024-08-30 19:01:30 +0200
commitc2b90d235fb5dd721898d8d41d73a51607654890 (patch)
tree91c0ebd6a1a0e3fc1d11100cef3088133363b6a9 /src/libstore/build
parente55ec75619b775bf0f5dd60e3da8de9bc8235f68 (diff)
libstore: don't ContinueImmediately where we can tail call
there's no reason to go through the event loop in these cases. returning ContinueImmediately here is just a very convoluted way of jumping to the state we've just set after unwinding one frame of the stack, which never matters in the cases changed here because there are no live RAII guards. Change-Id: I7c00948c22e3caf35e934c1a14ffd2d40efc5547
Diffstat (limited to 'src/libstore/build')
-rw-r--r--src/libstore/build/derivation-goal.cc4
-rw-r--r--src/libstore/build/substitution-goal.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index a75a674d1..1dda1b1b4 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -649,7 +649,7 @@ Goal::WorkResult DerivationGoal::inputsRealised(bool inBuildSlot)
slot to become available, since we don't need one if there is a
build hook. */
state = &DerivationGoal::tryToBuild;
- return ContinueImmediately{};
+ return tryToBuild(inBuildSlot);
}
void DerivationGoal::started()
@@ -772,7 +772,7 @@ Goal::WorkResult DerivationGoal::tryToBuild(bool inBuildSlot)
actLock.reset();
state = &DerivationGoal::tryLocalBuild;
- return ContinueImmediately{};
+ return tryLocalBuild(inBuildSlot);
}
Goal::WorkResult DerivationGoal::tryLocalBuild(bool inBuildSlot) {
diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc
index 673b3c503..1d24938e5 100644
--- a/src/libstore/build/substitution-goal.cc
+++ b/src/libstore/build/substitution-goal.cc
@@ -188,7 +188,7 @@ Goal::WorkResult PathSubstitutionGoal::referencesValid(bool inBuildSlot)
assert(worker.store.isValidPath(i));
state = &PathSubstitutionGoal::tryToRun;
- return ContinueImmediately{};
+ return tryToRun(inBuildSlot);
}
@@ -256,7 +256,7 @@ Goal::WorkResult PathSubstitutionGoal::finished(bool inBuildSlot)
/* Try the next substitute. */
state = &PathSubstitutionGoal::tryNext;
- return ContinueImmediately{};
+ return tryNext(inBuildSlot);
}
worker.markContentsGood(storePath);