Learn/Remade with Rust

rusty_alloc — A Pure-Rust Allocator That Replaces mimalloc

rusty_alloc is a pure-Rust mimalloc alternative: a memory-safe allocator for x86-64, aarch64, wasm, and RISC-V ESP that aborts on double-free.

Signed by M·
Bright sparks flying from an angle grinder on a metal workpiece in a dim workshop

Every process has an allocator. Most of them pretend they do not. The default heap is someone else's C — glibc malloc, jemalloc, mimalloc — and a double-free in that C is silent heap corruption until it is a CVE. Microsoft and Google still attribute most serious vulnerabilities to memory unsafety. The allocator is where those bugs go to hide.

rusty_alloc is a pure-Rust mimalloc alternative: a memory-safe allocator for x86-64 Linux and Windows, aarch64, wasm, and RISC-V ESP. rusty_alloc_default installs it as #[global_allocator]. SpaceDB recommends it on distributed nodes. It aborts on double-free instead of quietly ruining the heap. The catalog is Remade with Rust. The thesis is rebuilding the foundation of the internet. This article is the heap.

Why rusty_alloc Is The Mimalloc Alternative That Belongs In Rust

mimalloc is excellent C. It is still C. A memory-safe allocator is not "we were careful." It is an implementation in which the dangerous paths are fenced, the double-free is an abort, and the crate graph does not drag a C toolchain onto a wasm32 node. The NIST Secure Software Development Framework has been pushing organizations toward memory-safe languages. rusty_alloc is that push applied to the first library every binary links.

A mimalloc alternative that FFI's mimalloc has not replaced mimalloc. rusty_alloc is the remake. That is the Remade with Rust rule: the hot path is Rust.

Trust, Security, and Incentive start at the heap. Trust fails when a use-after-free in malloc becomes a wallet bug. Security fails when the allocator swallows a double-free. Incentive fails when the safer heap is slower or locked to one OS. rusty_alloc is how those three primitives apply to Box and Vec, not only to the vault UI.

What rusty_alloc Ships As A Memory-Safe Allocator

github.com/Remade-With-Rust/rusty_alloc is the source. The architecture follows mimalloc's — small pages, sharded free lists, the performance story people already measured — without the C. A memory-safe allocator that is also a mimalloc alternative has to be fast enough that nobody keeps the C "just for prod."

rusty_alloc_default Installs The Global Heap

#[global_allocator] lives in the deliverable, never a library. Two libraries that both declare it cannot link. rusty_alloc_default is the one-crate seam: add it to the binary, get rusty_alloc as the process allocator. That is how a workspace opts in once. A mimalloc alternative that requires every crate to know about the heap is a footgun.

SpaceDB recommends rusty_alloc on distributed nodes for the same reason the house stack does: a distributed cloud replica is a process under load, and the heap is the first thing that fragments.

Targets: x86-64, aarch64, wasm, RISC-V ESP

rusty_alloc is a memory-safe allocator that has to compile where the mesh compiles. x86-64 Linux and Windows. aarch64. wasm. RISC-V ESP. That last one is the Rust on Arduino story: the chip in the hallway does not get a glibc upgrade. A mimalloc alternative that only wins on a server is a server product. rusty_alloc is a substrate product.

WASM is the honesty test. A heap that needs clang fails it. rusty_alloc does not.

Abort On Double-Free, Not Silent Corruption

mimalloc can be configured to be strict. The default culture of C allocators is still "hope." rusty_alloc aborts on double-free. That is a Security choice. A crash is a signal. A corrupted heap is an exploit primitive. The NIST Zero Trust Architecture tells operators to assume breach at the network. A memory-safe allocator assumes the same at free.

The Electronic Frontier Foundation has documented how "secure product" claims collapse when the native stack is the old one. rusty_alloc is how the heap claim becomes checkable.

How rusty_alloc Feeds The Distributed Cloud

A mesh node that still links jemalloc is a C program with a Rust UI. rusty_alloc is the mimalloc alternative that lets the node stay Rust end to end.

Trust The Process, Secure The Heap

Trust is a process whose allocator you can read. Security is a memory-safe allocator that aborts instead of laundering a double-free into the next request. Incentive is a mimalloc alternative that is drop-in via rusty_alloc_default and fast enough to recommend in SpaceDB. If the safer heap loses, nobody moves.

Deputy vaults the crate so the heap's supply chain is yours. The Freedom Guide is the personal-data path; rusty_alloc is why that path's binaries do not secretly rent glibc's opinion of malloc.

Disco Party Nodes Run rusty_alloc

Disco Party is MATA's distributed cloud. Nodes allocate. A lot. SpaceDB replicas, capability checks, codec scratch, FFAI tensors — all of it hits the heap. rusty_alloc is the memory-safe allocator those nodes are told to use. Era 1 is the vault on that heap. Era 3 is work that settles on it.

The FTC cares about what you collect. The allocator cares about whether a bug in collection becomes a remote code-execution story. rusty_alloc shortens that story.

The Catalog Entry For rusty_alloc

Source is github.com/Remade-With-Rust/rusty_alloc. Shipping status lives on the Remade with Rust catalog. The mesh this heap feeds is what a distributed cloud is and the Disco Party. Digital Freedom is Trust, Security, and Incentive. rusty_alloc is the first crate in the graph.

If you came from the Learn index looking for a mimalloc alternative, this is the crate. If you came from mimalloc, this is the remake. Install rusty_alloc_default on the binary. Leave the library crates alone. The internet you want to own still allocates. rusty_alloc is how that sentence stays true without the C.

Compression that stays in the same memory-safe graph is rusty_zstd. The language case this allocator serves is why Rust becomes the standard. Why a stranger's machine cannot run a C heap is why a distributed cloud needs memory-safe Rust.