Skip to content

Commit

Permalink
Add missing source file
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jan 16, 2025
1 parent a9ae74b commit 4022035
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pulley/src/profile_disabled.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//! Stubs for when profiling is disabled to have the "executing_pc" field
//! basically compiled away.
use core::marker;

#[derive(Default, Clone)]
pub(crate) struct ExecutingPc;

impl ExecutingPc {
pub(crate) fn as_ref(&self) -> ExecutingPcRef<'_> {
ExecutingPcRef {
_marker: marker::PhantomData,
}
}
}

#[repr(transparent)]
pub(crate) struct ExecutingPcRef<'a> {
_marker: marker::PhantomData<&'a ()>,
}

impl ExecutingPcRef<'_> {
pub(crate) fn record(&self, pc: usize) {
let _ = pc;
}
}

0 comments on commit 4022035

Please sign in to comment.