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
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more