diff options
author | eldritch horrors <pennae@lix.systems> | 2024-09-25 23:57:46 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-09-29 12:09:24 +0000 |
commit | 3f7519526f7e2cd3ede01c3910fbfe2ddf0f051f (patch) | |
tree | c477bae7e352bab85849ca85bcbbb52bfd1200e1 /src/libstore/platform.cc | |
parent | 289e7a6b5a84c64142a10bdd875f8a06e3987579 (diff) |
libstore: have makeLocalDerivationGoal return unique_ptrs
these can be unique rather than shared because shared_ptr has a
converting constructor. preparatory refactor for something else
and not necessary on its own, and the extra allocations we must
do for shared_ptr control blocks isn't usually relevant anyway.
Change-Id: I5391715545240c6ec8e83a031206edafdfc6462f
Diffstat (limited to 'src/libstore/platform.cc')
-rw-r--r-- | src/libstore/platform.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstore/platform.cc b/src/libstore/platform.cc index f2c023c82..36f8e352a 100644 --- a/src/libstore/platform.cc +++ b/src/libstore/platform.cc @@ -25,7 +25,7 @@ std::shared_ptr<LocalStore> LocalStore::makeLocalStore(const Params & params) #endif } -std::shared_ptr<LocalDerivationGoal> LocalDerivationGoal::makeLocalDerivationGoal( +std::unique_ptr<LocalDerivationGoal> LocalDerivationGoal::makeLocalDerivationGoal( const StorePath & drvPath, const OutputsSpec & wantedOutputs, Worker & worker, @@ -34,17 +34,17 @@ std::shared_ptr<LocalDerivationGoal> LocalDerivationGoal::makeLocalDerivationGoa ) { #if __linux__ - return std::make_shared<LinuxLocalDerivationGoal>(drvPath, wantedOutputs, worker, isDependency, buildMode); + return std::make_unique<LinuxLocalDerivationGoal>(drvPath, wantedOutputs, worker, isDependency, buildMode); #elif __APPLE__ - return std::make_shared<DarwinLocalDerivationGoal>(drvPath, wantedOutputs, worker, isDependency, buildMode); + return std::make_unique<DarwinLocalDerivationGoal>(drvPath, wantedOutputs, worker, isDependency, buildMode); #elif __FreeBSD__ - return std::make_shared<FreeBSDLocalDerivationGoal>(drvPath, wantedOutputs, worker, isDependency, buildMode); + return std::make_unique<FreeBSDLocalDerivationGoal>(drvPath, wantedOutputs, worker, isDependency, buildMode); #else - return std::make_shared<FallbackLocalDerivationGoal>(drvPath, wantedOutputs, worker, isDependency, buildMode); + return std::make_unique<FallbackLocalDerivationGoal>(drvPath, wantedOutputs, worker, isDependency, buildMode); #endif } -std::shared_ptr<LocalDerivationGoal> LocalDerivationGoal::makeLocalDerivationGoal( +std::unique_ptr<LocalDerivationGoal> LocalDerivationGoal::makeLocalDerivationGoal( const StorePath & drvPath, const BasicDerivation & drv, const OutputsSpec & wantedOutputs, @@ -54,19 +54,19 @@ std::shared_ptr<LocalDerivationGoal> LocalDerivationGoal::makeLocalDerivationGoa ) { #if __linux__ - return std::make_shared<LinuxLocalDerivationGoal>( + return std::make_unique<LinuxLocalDerivationGoal>( drvPath, drv, wantedOutputs, worker, isDependency, buildMode ); #elif __APPLE__ - return std::make_shared<DarwinLocalDerivationGoal>( + return std::make_unique<DarwinLocalDerivationGoal>( drvPath, drv, wantedOutputs, worker, isDependency, buildMode ); #elif __FreeBSD__ - return std::make_shared<FreeBSDLocalDerivationGoal>( + return std::make_unique<FreeBSDLocalDerivationGoal>( drvPath, drv, wantedOutputs, worker, isDependency, buildMode ); #else - return std::make_shared<FallbackLocalDerivationGoal>( + return std::make_unique<FallbackLocalDerivationGoal>( drvPath, drv, wantedOutputs, worker, isDependency, buildMode ); #endif |