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§
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§fn default() -> MemoryAllocatorBackend
fn default() -> MemoryAllocatorBackend
source§impl PartialEq<MemoryAllocatorBackend> for MemoryAllocatorBackend
impl PartialEq<MemoryAllocatorBackend> for MemoryAllocatorBackend
source§fn eq(&self, other: &MemoryAllocatorBackend) -> bool
fn eq(&self, other: &MemoryAllocatorBackend) -> bool
self
and other
values to be equal, and is used
by ==
.