From 810b1cec3f022c78a430ed9633a6afa210900b2a 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:15:20 +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 5a425859..303fb95d 100644 --- a/src/internal/core.rs +++ b/src/internal/core.rs @@ -70,6 +70,7 @@ impl State { } /// Add an incompatibility to the state. + #[cold] pub(crate) fn add_incompatibility_from_dependencies( &mut self, package_id: PackageId, @@ -91,6 +92,7 @@ impl State { /// Unit propagation is the core mechanism of the solving algorithm. /// CF + #[cold] pub(crate) fn unit_propagation( &mut self, package_id: PackageId, @@ -170,6 +172,7 @@ impl State { /// Return the root cause or the terminal incompatibility. /// CF + #[cold] fn conflict_resolution( &mut self, incompatibility: IncompDpId, diff --git a/src/internal/partial_solution.rs b/src/internal/partial_solution.rs index fb938d27..f5250f7b 100644 --- a/src/internal/partial_solution.rs +++ b/src/internal/partial_solution.rs @@ -285,6 +285,7 @@ impl PartialSolution { } } + #[cold] pub(crate) fn pick_highest_priority_pkg( &mut self, mut prioritizer: impl FnMut(PackageId, VersionSet) -> DP::Priority, diff --git a/src/solver.rs b/src/solver.rs index 93998186..9303fbdc 100644 --- a/src/solver.rs +++ b/src/solver.rs @@ -67,6 +67,7 @@ use crate::{ /// 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: &mut DP, package: DP::P,