Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/pulley/src/profile_disabled.rs
1691 views
1
//! Stubs for when profiling is disabled to have the "executing_pc" field
2
//! basically compiled away.
3
4
use core::marker;
5
6
#[derive(Default, Clone)]
7
pub(crate) struct ExecutingPc;
8
9
impl ExecutingPc {
10
pub(crate) fn as_ref(&self) -> ExecutingPcRef<'_> {
11
ExecutingPcRef {
12
_marker: marker::PhantomData,
13
}
14
}
15
16
pub(crate) fn set_done(&self) {}
17
}
18
19
#[derive(Copy, Clone)]
20
#[repr(transparent)]
21
pub(crate) struct ExecutingPcRef<'a> {
22
_marker: marker::PhantomData<&'a ()>,
23
}
24
25
impl ExecutingPcRef<'_> {
26
pub(crate) fn record(&self, pc: usize) {
27
let _ = pc;
28
}
29
}
30
31