From 6bbe19f127ec74604b38a0531d4f94a373173859 Mon Sep 17 00:00:00 2001 From: x-hgg-x <39058530+x-hgg-x@users.noreply.github.com> Date: Thu, 21 Nov 2024 22:26:33 +0100 Subject: [PATCH] Add cold annotations --- src/internal/core.rs | 3 +++ src/internal/partial_solution.rs | 1 + src/solver.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/src/internal/core.rs b/src/internal/core.rs index 15bf176a..a4c189bc 100644 --- a/src/internal/core.rs +++ b/src/internal/core.rs @@ -79,6 +79,7 @@ impl State { } /// Add an incompatibility to the state. + #[cold] pub(crate) fn add_incompatibility_from_dependencies( &mut self, package: Id, @@ -105,6 +106,7 @@ impl State { /// Unit propagation is the core mechanism of the solving algorithm. /// CF + #[cold] pub(crate) fn unit_propagation( &mut self, package: Id, @@ -187,6 +189,7 @@ impl State { /// Return the root cause or the terminal incompatibility. /// CF #[allow(clippy::type_complexity)] + #[cold] fn conflict_resolution( &mut self, incompatibility: IncompDpId, diff --git a/src/internal/partial_solution.rs b/src/internal/partial_solution.rs index 7d4d2c8e..c6328aac 100644 --- a/src/internal/partial_solution.rs +++ b/src/internal/partial_solution.rs @@ -267,6 +267,7 @@ impl PartialSolution { } } + #[cold] pub(crate) fn pick_highest_priority_pkg( &mut self, prioritizer: impl Fn(Id, &DP::VS) -> DP::Priority, diff --git a/src/solver.rs b/src/solver.rs index ac032913..a8aff4bf 100644 --- a/src/solver.rs +++ b/src/solver.rs @@ -70,6 +70,7 @@ use crate::{DependencyConstraints, Map, Package, PubGrubError, SelectedDependenc /// Main function of the library. /// Finds a set of packages satisfying dependency bounds for a given package + version pair. +#[cold] pub fn resolve( dependency_provider: &DP, package: DP::P,