pulley_interpreter/
profile_disabled.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//! 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,
        }
    }

    pub(crate) fn set_done(&self) {}
}

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

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