Skip to main content

PacingOffsets

Struct PacingOffsets 

Source
pub struct PacingOffsets { /* private fields */ }
Expand description

The pacing predicate’s operands, as displacements: where the Heap hangs off a RuntimeContext, and where its two pacing words sit inside it.

§Not a constructor argument, anywhere

Self::new takes nothing and reads all three off Heap’s own Heap::BYTES_SINCE_COLLECT_OFFSET and Heap::COLLECT_THRESHOLD_OFFSET, so a site that described a table to probe — or a block to claim — without carrying the pacing predicate’s operands has no spelling. That is the one thing InlineInternSite exists to withhold, and skipping the predicate is the one thing ADR-040’s Safepoint exists to make unwritable.

§One value, because the compare has one authority

Heap::collection_is_due is the one statement of the predicate and generated code is the one reader that cannot call it: it loads these two words and compares them. The direction (>=, so that a zero threshold is always due) and the operand order are therefore transcribed from a rule the compiler cannot check, and every transcription is a fresh chance to write it backwards. Both InlineInternSite and InlineClaimSite carry this value rather than three fields each, so the backend’s emit_pacing_test — the one place the transcription lives — cannot pair one site’s since with another’s threshold.

Implementations§

Source§

impl PacingOffsets

Source

pub const fn heap_offset(self) -> usize

Where the Heap pointer sits in a RuntimeContext. The first load of the sequence, and the base the two pacing loads are relative to.

Source

pub const fn bytes_since_collect_offset(self) -> usize

Where Heap::bytes_since_collect sits within a Heap.

The predicate’s left operand — and, for the claim sequence, the word it loads a second time and stores back, once, at the end: the pacing charge, which is not the predicate.

Source

pub const fn collect_threshold_offset(self) -> usize

Where Heap::collect_threshold sits within a Heap.

Generated code loads this word and the one above and takes the branch since >= threshold to its cold path. That is Heap::collection_is_due transcribed, and that function’s doc is where the obligation is written down.

Trait Implementations§

Source§

impl Clone for PacingOffsets

Source§

fn clone(&self) -> PacingOffsets

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PacingOffsets

Source§

impl Debug for PacingOffsets

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PacingOffsets

Source§

impl PartialEq for PacingOffsets

Source§

fn eq(&self, other: &PacingOffsets) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PacingOffsets

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.