pub struct MallocState {
pub malloc_count: usize,
pub malloc_size: usize,
pub malloc_limit: usize,
}Expand description
Tracked heap usage, matching QuickJS JSMallocState.
Fields§
§malloc_count: usize§malloc_size: usize§malloc_limit: usizeImplementations§
Source§impl MallocState
impl MallocState
pub fn new() -> Self
pub fn set_limit(&mut self, limit: usize)
pub fn would_exceed(&self, size: usize) -> bool
pub fn record_alloc(&mut self, usable_size: usize)
pub fn record_free(&mut self, usable_size: usize)
Trait Implementations§
Source§impl Clone for MallocState
impl Clone for MallocState
Source§fn clone(&self) -> MallocState
fn clone(&self) -> MallocState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MallocState
impl Debug for MallocState
Source§impl Default for MallocState
impl Default for MallocState
Source§fn default() -> MallocState
fn default() -> MallocState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MallocState
impl RefUnwindSafe for MallocState
impl Send for MallocState
impl Sync for MallocState
impl Unpin for MallocState
impl UnsafeUnpin for MallocState
impl UnwindSafe for MallocState
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