Skip to main content

Crate rusty_alloc_api

Crate rusty_alloc_api 

Source
Expand description

Safe Rust-native surface of rusty_alloc (plan §5.14).

From M2, RustyAlloc is a real core::alloc::GlobalAlloc:

#[global_allocator]
static ALLOC: rusty_alloc_api::RustyAlloc = rusty_alloc_api::RustyAlloc;

Heap and the Allocator trait impl land at M6. This crate stays a thin veneer over the same internals as the C ABI — no separate code path, so corpus numbers speak for Rust users too.

Structs§

Heap
A first-class heap (plan §5.14): Drop runs mi_heap_delete semantics (blocks migrate to the thread’s backing heap and stay valid) unless built with Heap::new_destroyable, where Drop releases every block at once. The destroyable form inherits C’s contract: callers must not touch its blocks after drop (a lifetime-carrying Allocator impl that makes this unrepresentable is the planned follow-up once allocator_api stabilizes).
RustyAlloc
The global allocator handle (zero-sized).

Constants§

MI_COMPAT_VERSION
The mimalloc version we are API- and ABI-compatible with, in mimalloc’s encoding (major·10⁴ + minor·10² + patch): v2.4.5. mi_version() reports this.
VERSION
Our own semantic version, from the crate manifest.

Functions§

version
mimalloc-encoded compat version, as reported by the C ABI mi_version().