pub struct Allocator<'ctx, Ctx: 'ctx = ()> { /* private fields */ }Expand description
A custom allocator that libghostty uses for its memory allocations.
The allocator may depend on some external state Ctx for the
duration of lifetime 'ctx. This is useful for adapting external,
stateful allocators that may not have a 'static lifetime.
One example of a custom allocator that does have a 'static
lifetime is Rust’s own default allocator, which can also be used
within libghostty as Allocator::GLOBAL.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'ctx, Ctx> Freeze for Allocator<'ctx, Ctx>
impl<'ctx, Ctx> RefUnwindSafe for Allocator<'ctx, Ctx>where
Ctx: RefUnwindSafe,
impl<'ctx, Ctx = ()> !Send for Allocator<'ctx, Ctx>
impl<'ctx, Ctx = ()> !Sync for Allocator<'ctx, Ctx>
impl<'ctx, Ctx> Unpin for Allocator<'ctx, Ctx>
impl<'ctx, Ctx> UnsafeUnpin for Allocator<'ctx, Ctx>
impl<'ctx, Ctx> UnwindSafe for Allocator<'ctx, Ctx>where
Ctx: RefUnwindSafe,
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