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§
Source§impl Clone for MemoryAllocatorBackend
impl Clone for MemoryAllocatorBackend
Source§fn clone(&self) -> MemoryAllocatorBackend
fn clone(&self) -> MemoryAllocatorBackend
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MemoryAllocatorBackend
impl Debug for MemoryAllocatorBackend
Source§impl Default for MemoryAllocatorBackend
impl Default for MemoryAllocatorBackend
Source§impl From<MemoryAllocatorBackend> for String
impl From<MemoryAllocatorBackend> for String
Source§fn from(v: MemoryAllocatorBackend) -> Self
fn from(v: MemoryAllocatorBackend) -> Self
Source§impl PartialEq for MemoryAllocatorBackend
impl PartialEq for MemoryAllocatorBackend
Source§impl ToString for MemoryAllocatorBackend
impl ToString for MemoryAllocatorBackend
Source§impl TryFrom<&str> for MemoryAllocatorBackend
impl TryFrom<&str> for MemoryAllocatorBackend
Source§impl TryFrom<String> for MemoryAllocatorBackend
impl TryFrom<String> for MemoryAllocatorBackend
impl Copy for MemoryAllocatorBackend
impl Eq for MemoryAllocatorBackend
impl StructuralPartialEq for MemoryAllocatorBackend
Auto Trait Implementations§
impl Freeze for MemoryAllocatorBackend
impl RefUnwindSafe for MemoryAllocatorBackend
impl Send for MemoryAllocatorBackend
impl Sync for MemoryAllocatorBackend
impl Unpin for MemoryAllocatorBackend
impl UnwindSafe for MemoryAllocatorBackend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more