Enum pyembed::MemoryAllocatorBackend
source · [−]pub enum MemoryAllocatorBackend {
Default,
Jemalloc,
Mimalloc,
Snmalloc,
Rust,
}
Expand description
Defines a backend for a memory allocator.
This says which memory allocator API / library to configure the Python interpreter to use.
Not all allocators are available in all program builds.
Serialization type: string
Variants
Default
The default allocator as configured by Python.
This likely utilizes the system default allocator, normally the
malloc()
, free()
, etc functions from the libc implementation being
linked against.
Serialized value: default
Jemalloc
Use the jemalloc allocator.
Requires the binary to be built with jemalloc support.
Never available on Windows.
Serialized value: jemalloc
Mimalloc
Use the mimalloc allocator (https://github.com/microsoft/mimalloc).
Requires the binary to be built with mimalloc support.
Serialized value: mimalloc
Snmalloc
Use the snmalloc allocator (https://github.com/microsoft/snmalloc).
Not always available.
Serialized value: snmalloc
Rust
Use Rust’s global allocator.
The Rust allocator is less efficient than other allocators because of overhead tracking allocations. For optimal performance, use the default allocator. Or if Rust is using a custom global allocator, use the enum variant corresponding to that allocator.
Serialized value: rust
Trait Implementations
sourceimpl Clone for MemoryAllocatorBackend
impl Clone for MemoryAllocatorBackend
sourcefn clone(&self) -> MemoryAllocatorBackend
fn clone(&self) -> MemoryAllocatorBackend
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MemoryAllocatorBackend
impl Debug for MemoryAllocatorBackend
sourceimpl Default for MemoryAllocatorBackend
impl Default for MemoryAllocatorBackend
sourcefn default() -> MemoryAllocatorBackend
fn default() -> MemoryAllocatorBackend
Returns the “default value” for a type. Read more
sourceimpl ToString for MemoryAllocatorBackend
impl ToString for MemoryAllocatorBackend
sourceimpl<'_> TryFrom<&'_ str> for MemoryAllocatorBackend
impl<'_> TryFrom<&'_ str> for MemoryAllocatorBackend
sourceimpl TryFrom<String> for MemoryAllocatorBackend
impl TryFrom<String> for MemoryAllocatorBackend
impl Copy for MemoryAllocatorBackend
impl StructuralPartialEq for MemoryAllocatorBackend
Auto Trait Implementations
impl RefUnwindSafe for MemoryAllocatorBackend
impl Send for MemoryAllocatorBackend
impl Sync for MemoryAllocatorBackend
impl Unpin for MemoryAllocatorBackend
impl UnwindSafe for MemoryAllocatorBackend
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more