pub struct TCMalloc;
Expand description
A memory allocator that can be registered as the standard library’s default
through the #[global_allocator]
attribute.
Implementations§
Source§impl TCMalloc
impl TCMalloc
Sourcepub fn needs_process_background_actions() -> bool
Available on crate feature extension
only.
pub fn needs_process_background_actions() -> bool
extension
only.Return true if process_background_actions
should be called on this platform.
Sourcepub fn process_background_actions()
Available on crate feature extension
only.
pub fn process_background_actions()
extension
only.Runs housekeeping actions for the allocator off of the main allocation path.
Should be run in the background thread. May return or may not return.
Use process_background_actions_thread()
if possible.
Sourcepub fn process_background_actions_thread() -> Option<JoinHandle<()>>
Available on crate features extension
and std
only.
pub fn process_background_actions_thread() -> Option<JoinHandle<()>>
extension
and std
only.Runs housekeeping actions for the allocator in the background thread.
Trait Implementations§
Source§impl GlobalAlloc for TCMalloc
impl GlobalAlloc for TCMalloc
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout
. Read moreAuto Trait Implementations§
impl Freeze for TCMalloc
impl RefUnwindSafe for TCMalloc
impl Send for TCMalloc
impl Sync for TCMalloc
impl Unpin for TCMalloc
impl UnwindSafe for TCMalloc
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