PoolingAllocatorMetrics

Struct PoolingAllocatorMetrics 

Source
pub struct PoolingAllocatorMetrics { /* private fields */ }
Available on crate feature pooling-allocator only.
Expand description

PoolingAllocatorMetrics provides access to runtime metrics of a pooling allocator configured with crate::InstanceAllocationStrategy::Pooling.

This is a cheap cloneable handle which can be obtained with Engine::pooling_allocator_metrics.

Implementations§

Source§

impl PoolingAllocatorMetrics

Source

pub fn core_instances(&self) -> u64

Available on crate feature runtime only.

Returns the number of core (module) instances currently allocated.

Source

pub fn component_instances(&self) -> u64

Available on crate feature runtime only.

Returns the number of component instances currently allocated.

Source

pub fn memories(&self) -> usize

Available on crate feature runtime only.

Returns the number of WebAssembly memories currently allocated.

Source

pub fn tables(&self) -> usize

Available on crate feature runtime only.

Returns the number of WebAssembly tables currently allocated.

Source

pub fn stacks(&self) -> usize

Available on crate features runtime and async only.

Returns the number of WebAssembly stacks currently allocated.

Source

pub fn gc_heaps(&self) -> usize

Available on crate features runtime and gc only.

Returns the number of WebAssembly GC heaps currently allocated.

Source

pub fn unused_warm_memories(&self) -> u32

Available on crate feature runtime only.

Returns the number of slots for linear memories in this allocator which are not currently in use but were previously used.

A “warm” slot means that there was a previous instantiation of a memory in that slot. Warm slots are favored in general for allocating new memories over using a slot that has never been used before.

Source

pub fn unused_memory_bytes_resident(&self) -> usize

Available on crate feature runtime only.

Returns the number of bytes in this pooling allocator which are not part of any in-used linear memory slot but were previously used and are kept resident via the *_keep_resident configuration options.

Source

pub fn unused_warm_tables(&self) -> u32

Available on crate feature runtime only.

Returns the number of slots for tables in this allocator which are not currently in use but were previously used.

A “warm” slot means that there was a previous instantiation of a table in that slot. Warm slots are favored in general for allocating new tables over using a slot that has never been used before.

Source

pub fn unused_table_bytes_resident(&self) -> usize

Available on crate feature runtime only.

Returns the number of bytes in this pooling allocator which are not part of any in-used linear table slot but were previously used and are kept resident via the *_keep_resident configuration options.

Source

pub fn unused_warm_stacks(&self) -> u32

Available on crate features runtime and async only.

Returns the number of slots for stacks in this allocator which are not currently in use but were previously used.

A “warm” slot means that there was a previous use of a stack in that slot. Warm slots are favored in general for allocating new stacks over using a slot that has never been used before.

Source

pub fn unused_stack_bytes_resident(&self) -> Option<usize>

Available on crate features runtime and async only.

Returns the number of bytes in this pooling allocator which are not part of any in-used linear stack slot but were previously used and are kept resident via the *_keep_resident configuration options.

This returns None if the async_stack_zeroing option is disabled or if the platform doesn’t manage stacks (e.g. Windows returns None).

Trait Implementations§

Source§

impl Clone for PoolingAllocatorMetrics

Available on crate feature runtime only.
Source§

fn clone(&self) -> PoolingAllocatorMetrics

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.