summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_engine/executor/executor.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2025-02-14 13:04:28 +0100
committerMaksim Denisov <denisov.maksim@huawei.com>2025-02-19 17:50:30 +0100
commit56df7b3916f669edd315808f92e63e7553367f1d (patch)
tree93a269402da87f33a9e95f82e540f6fef667aa6b /src/buildtool/execution_engine/executor/executor.hpp
parent888573c86e2eff6d1657f42955c388cda347680d (diff)
downloadjustbuild-56df7b3916f669edd315808f92e63e7553367f1d.tar.gz
Store HashFunction by value
Although references give an additional information about ownership, they introduce additional design difficulties.
Diffstat (limited to 'src/buildtool/execution_engine/executor/executor.hpp')
-rw-r--r--src/buildtool/execution_engine/executor/executor.hpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp
index 8519639f..3926a330 100644
--- a/src/buildtool/execution_engine/executor/executor.hpp
+++ b/src/buildtool/execution_engine/executor/executor.hpp
@@ -84,7 +84,7 @@ class ExecutorImpl {
IExecutionApi const& api,
ExecutionProperties const& merged_properties,
gsl::not_null<RemoteContext const*> const& remote_context,
- gsl::not_null<HashFunction const*> const& hash_function,
+ HashFunction hash_function,
std::chrono::milliseconds const& timeout,
IExecutionAction::CacheFlag cache_flag,
gsl::not_null<Statistics*> const& stats,
@@ -752,8 +752,7 @@ class ExecutorImpl {
[[nodiscard]] static auto GetAlternativeEndpoint(
const ExecutionProperties& properties,
const gsl::not_null<RemoteContext const*>& remote_context,
- const gsl::not_null<HashFunction const*>& hash_function)
- -> std::unique_ptr<BazelApi> {
+ HashFunction hash_function) -> std::unique_ptr<BazelApi> {
for (auto const& [pred, endpoint] :
remote_context->exec_config->dispatch) {
bool match = true;
@@ -819,7 +818,7 @@ class Executor {
context_.remote_context->exec_config->platform_properties,
action->ExecutionProperties()),
context_.remote_context,
- &context_.apis->hash_function,
+ context_.apis->hash_function,
Impl::ScaleTime(timeout_, action->TimeoutScale()),
action->NoCache() ? CF::DoNotCacheOutput : CF::CacheOutput,
context_.statistics,
@@ -842,7 +841,7 @@ class Executor {
context_.remote_context->exec_config->platform_properties,
action->ExecutionProperties()),
context_.remote_context,
- &context_.apis->hash_function,
+ context_.apis->hash_function,
Impl::ScaleTime(timeout_, action->TimeoutScale()),
action->NoCache() ? CF::DoNotCacheOutput : CF::CacheOutput,
context_.statistics,
@@ -916,7 +915,7 @@ class Rebuilder {
context_.remote_context->exec_config->platform_properties,
action->ExecutionProperties()),
context_.remote_context,
- &context_.apis->hash_function,
+ context_.apis->hash_function,
Impl::ScaleTime(timeout_, action->TimeoutScale()),
CF::PretendCached,
context_.statistics,
@@ -935,7 +934,7 @@ class Rebuilder {
context_.remote_context->exec_config->platform_properties,
action->ExecutionProperties()),
context_.remote_context,
- &context_.apis->hash_function,
+ context_.apis->hash_function,
Impl::ScaleTime(timeout_, action->TimeoutScale()),
CF::FromCacheOnly,
context_.statistics,