GlobalAllocator

Trait GlobalAllocator 

Source
pub unsafe trait GlobalAllocator
where Self: Allocator,
{ // Required methods fn __do_not_implement(); fn clone_alloc<T>(alloc: &Self::Alloc<T>) -> Self::Alloc<T>; }
Expand description

The trait governing a global allocator.

§Safety

Implementing this trait promises that the implementing allocator ultimately is backed by the global allocator Global and subsequently is what will be used to allocate and free data.

Required Methods§

Source

fn __do_not_implement()

Do not implement this trait. It is internal to Musli and will change.

Source

fn clone_alloc<T>(alloc: &Self::Alloc<T>) -> Self::Alloc<T>

Clone an allocation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§