#8499·egui

Opt-in rusty_alloc feature alongside mimalloc in epaint

Author: halejordan391Created Sep 4, 2026Updated Sep 10, 2026

The value of integrating

egui is currently pulling in mimalloc for allocation; epaint's Cargo.toml pins mimalloc = "^0.1.52".

If you added rusty_alloc as a feature, the same allocator would run on native and wasm with no C toolchain and no emscripten. Widgets, painter, eframe, and the public API stay as they are.

Not asking you to swap the default; this would sit behind a feature flag.

How to integrate

Add it behind an off-by-default Cargo feature in epaint, leaving the mimalloc path as it is. Nothing changes for users until they opt in.

toml
[features]
rusty-alloc = ["dep:rusty_alloc-api"]

[dependencies]
rusty_alloc-api = { version = "1.1.6", optional = true }

The rusty_alloc README's call site, in the binary that installs a global allocator:

rust
use rusty_alloc_api::RustyAlloc;

#[global_allocator]
static ALLOC: RustyAlloc = RustyAlloc;

Flip the feature on in CI, compare on your own workloads, and drop the feature with one line if it does not hold up. Your API, tests, and output stay the same.

Remade With Rust & MATA

We are rebuilding the stack in safe Rust — codecs, parsers, compression, identity, storage — so projects can drop C dependencies without giving up performance. Other crates live at https://github.com/Remade-With-Rust. Close this issue if this is a poor fit.

  • x.com/farmer_timmm