Skip to main content

PinnedHostBuf

Struct PinnedHostBuf 

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

Owned page-locked CACHEABLE host buffer (flags=0, deliberately NOT write-combined) for the prefix-cache host tier (lane/kv-host-spill-20260830). Same allocation class as PinnedStage above and for the same reason: ctx().alloc_pinned is CU_MEMHOSTALLOC_WRITECOMBINED, which is right for H2D-only staging but pathologically slow for host READS (see the HostBuf CAVEAT in model.rs), and these bytes are CPU-read by the MEMRA_KV_HOST_VERIFY digest arm. Public because the server’s host-tier cache owns these buffers across requests.

Implementations§

Source§

impl PinnedHostBuf

Source

pub fn new(len: usize) -> Result<Self, Box<dyn Error>>

Allocate len pinned cacheable bytes (a zero-length request still pins one byte so the pointer stays valid, mirroring the device planes’ alloc_u8(kb.max(1)) convention).

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn as_slice(&self) -> &[u8]

Source

pub fn as_mut_slice(&mut self) -> &mut [u8]

Trait Implementations§

Source§

impl Drop for PinnedHostBuf

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for PinnedHostBuf

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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.