#allocator #counter #geiger

alloc_geiger

A Rust allocator which makes sound when active, like a Geiger counter

5 releases (3 breaking)

Uses new Rust 2024

0.4.0 Dec 23, 2025
0.3.0 Mar 10, 2025
0.2.0 Nov 11, 2023
0.1.1 Aug 13, 2019
0.1.0 Aug 13, 2019

#288 in Memory management

MIT/Apache

15KB
173 lines

alloc_geiger

Latest Version docs

A Rust allocator which makes sound when active, like a Geiger counter.

The rodio crate is used to emit sinc pulses each time the allocator is used, excluding its own allocator activity.

Inspired by Malloc Geiger.

Usage

To use alloc_geiger add it as a dependency:

# Cargo.toml
[dependencies]
alloc_geiger = "0.3"

To set alloc_geiger::Geiger as the global allocator, it must be initialized with an underlying allocator. The type System alias and the new() method make it easy to use the default system allocator:

#[global_allocator]
static ALLOC: alloc_geiger::System = alloc_geiger::System::new();

Alternatives like jemallocator may also be used:

use alloc_geiger::Geiger;
use jemallocator::Jemalloc;

#[global_allocator]
static ALLOC: Geiger<Jemalloc> = Geiger::with_alloc(Jemalloc);

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in alloc_geiger by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2–33MB
~433K SLoC