Skip to content

Commit

Permalink
Add cold annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
x-hgg-x committed Nov 21, 2024
1 parent c043889 commit 810b1ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/internal/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl<DP: DependencyProvider> State<DP> {
}

/// Add an incompatibility to the state.
#[cold]
pub(crate) fn add_incompatibility_from_dependencies(
&mut self,
package_id: PackageId,
Expand All @@ -91,6 +92,7 @@ impl<DP: DependencyProvider> State<DP> {

/// Unit propagation is the core mechanism of the solving algorithm.
/// CF <https://github.com/dart-lang/pub/blob/master/doc/solver.md#unit-propagation>
#[cold]
pub(crate) fn unit_propagation(
&mut self,
package_id: PackageId,
Expand Down Expand Up @@ -170,6 +172,7 @@ impl<DP: DependencyProvider> State<DP> {

/// Return the root cause or the terminal incompatibility.
/// CF <https://github.com/dart-lang/pub/blob/master/doc/solver.md#unit-propagation>
#[cold]
fn conflict_resolution(
&mut self,
incompatibility: IncompDpId<DP>,
Expand Down
1 change: 1 addition & 0 deletions src/internal/partial_solution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ impl<DP: DependencyProvider> PartialSolution<DP> {
}
}

#[cold]
pub(crate) fn pick_highest_priority_pkg(
&mut self,
mut prioritizer: impl FnMut(PackageId, VersionSet) -> DP::Priority,
Expand Down
1 change: 1 addition & 0 deletions src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DP: DependencyProvider>(
dependency_provider: &mut DP,
package: DP::P,
Expand Down

0 comments on commit 810b1ce

Please sign in to comment.