pub struct PythonMemoryAllocator { /* private fields */ }
Expand description

Represents a custom memory allocator that can be registered with Python.

Implementations

Construct an instance from a MemoryAllocatorBackend.

Returns None if the backend shouldn’t be defined.

Construct a new instance using Rust’s global allocator.

Obtain the backend used for this instance.

Set this allocator to be the allocator for a certain “domain” in a Python interpreter.

This should be called before Py_Initialize*().

Set the arena allocator used by the pymalloc allocator.

This only has an effect if the pymalloc allocator is registered to the mem or object allocator domains.

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 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.