Crate malloc_bind [−] [src]
Bindings for the C
malloc API to Rust allocators.
This crate provides a mechanism to construct a C allocator - an implementation of
free, and related functions - that is backed by a Rust allocator (an implementation of the
In order to create bindings, two things must be provided: an implementation of the
trait, and an implementation of the
LayoutFinder trait (defined in this crate). Since the C
API does not provide size or alignment on
free, but the Rust
Alloc API requires both size
and alignment on
dealloc, a mapping must be maintained between allocated objects and those
objects' size and alignment. The
LayoutFinder provides this functionality.
A wrapper for a Rust allocator providing C bindings.
A mechanism for mapping allocated objects to their