pub struct MemoryCreatorConfig {
pub max_linear_memory_bytes: usize,
}Expand description
Tunable knobs for TensorWasmMemoryCreator.
Operators with multi-tenant deployments may want a tighter per-instance
linear-memory cap than the workspace-wide
HARD_MAX_LINEAR_MEMORY_BYTES ceiling (4 GiB, matching the wasm32 spec
maximum). This config exposes that knob without changing the absolute
ceiling — new_memory always enforces min(config.max_linear_memory_bytes, HARD_MAX_LINEAR_MEMORY_BYTES), so the const remains a hard upper bound
that no configured value can exceed.
Fields§
§max_linear_memory_bytes: usizeMaximum bytes any single Wasm linear memory may be backed by. Capped
by HARD_MAX_LINEAR_MEMORY_BYTES; values above the const are
silently clamped to the const. Defaults to HARD_MAX_LINEAR_MEMORY_BYTES
so default behaviour is unchanged.
Implementations§
Source§impl MemoryCreatorConfig
impl MemoryCreatorConfig
Sourcepub fn effective_max_linear_memory_bytes(&self) -> usize
pub fn effective_max_linear_memory_bytes(&self) -> usize
The effective per-instance cap: the smaller of the configured value
and the workspace’s HARD_MAX_LINEAR_MEMORY_BYTES ceiling.
Trait Implementations§
Source§impl Clone for MemoryCreatorConfig
impl Clone for MemoryCreatorConfig
Source§fn clone(&self) -> MemoryCreatorConfig
fn clone(&self) -> MemoryCreatorConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryCreatorConfig
impl Debug for MemoryCreatorConfig
Auto Trait Implementations§
impl Freeze for MemoryCreatorConfig
impl RefUnwindSafe for MemoryCreatorConfig
impl Send for MemoryCreatorConfig
impl Sync for MemoryCreatorConfig
impl Unpin for MemoryCreatorConfig
impl UnsafeUnpin for MemoryCreatorConfig
impl UnwindSafe for MemoryCreatorConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more