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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.