pub struct Allocator;Expand description
An allocator.
Implementations§
Source§impl Allocator
impl Allocator
Sourcepub unsafe fn initialize()
pub unsafe fn initialize()
Sourcepub unsafe fn register_current_thread() -> Result<(), Error>
pub unsafe fn register_current_thread() -> Result<(), Error>
Registers a current thread to a collector.
§Safety
This function must not be called in a main thread.
Sourcepub unsafe fn set_stack_bottom(bottom: *const u8)
pub unsafe fn set_stack_bottom(bottom: *const u8)
Sets a bottom of a stack.
You do not have to call this function in most cases. A collector detects the bottom on initialization automatically.
§Safety
The bottom address must be valid.
Sourcepub unsafe fn unregister_current_thread()
pub unsafe fn unregister_current_thread()
Sourcepub fn force_collect()
pub fn force_collect()
Runs a garbage collection forcibly.
Trait Implementations§
Source§impl GlobalAlloc for Allocator
impl GlobalAlloc for Allocator
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 Allocator
impl RefUnwindSafe for Allocator
impl Send for Allocator
impl Sync for Allocator
impl Unpin for Allocator
impl UnsafeUnpin for Allocator
impl UnwindSafe for Allocator
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