only_alloc 0.1.0

An allocator wrapper that disables deallocating memory within it.
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 12.79 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 896.19 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Kyza

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.