only_alloc

Crates.ioonly_alloc
lib.rsonly_alloc
version0.1.0
created_at2025-05-06 23:22:47.223277+00
updated_at2025-05-06 23:22:47.223277+00
descriptionAn allocator wrapper that disables deallocating memory within it.
homepagehttps://github.com/Kyza/only_alloc
repository
max_upload_size
id1663077
size13,291
Kyza (Kyza)

documentation

README

only_alloc

github.com crates.io docs.rs

only_alloc wraps another allocator and disables deallocating memory within it.

It can be used either as a global allocator or as an allocator from #![feature(allocator_api)].

It can be used with no_std environments and it contains zero dependencies.

use mimalloc::MiMalloc;
use only_alloc::GlobalOnlyAlloc;

#[global_allocator]
static ONLY_MIMALLOC: GlobalOnlyAlloc<MiMalloc> = GlobalOnlyAlloc(MiMalloc);

Installation

cargo add only_alloc

Why?

Maybe you have a use for this because I don't. It might be microscopically faster for CLI tools. I simply enjoyed writing it.

Commit count: 0

cargo fmt