pub struct MixTrace { /* private fields */ }Expand description
One frame’s worth of per-CPU-cycle mix records.
The index is the cycle offset from Self::first_cycle, so no per-record
timestamp is stored — that is what keeps the record at 16 bytes.
Two different numbers follow from that, and the first draft of this comment
conflated them. An NTSC frame of 29,781 records is ~465 KiB; the
allocation is MIX_CAP records reserved up front, which is 576 KiB,
because the cap is sized from Dendy (the longest frame) rather than from
NTSC. The buffer is therefore always the worst case, never the typical one.
Implementations§
Source§impl MixTrace
impl MixTrace
Sourcepub fn clear(&mut self, first_cycle: u64)
pub fn clear(&mut self, first_cycle: u64)
Drop every record and re-anchor the trace at first_cycle.
Sourcepub fn push(&mut self, rec: MixRecord)
pub fn push(&mut self, rec: MixRecord)
Append one mixed cycle. Beyond MIX_CAP the record is dropped and the
trace is flagged Self::truncated.
Sourcepub const fn first_cycle(&self) -> u64
pub const fn first_cycle(&self) -> u64
CPU cycle the first record corresponds to.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MixTrace
impl RefUnwindSafe for MixTrace
impl Send for MixTrace
impl Sync for MixTrace
impl Unpin for MixTrace
impl UnsafeUnpin for MixTrace
impl UnwindSafe for MixTrace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more