alloc_geiger

Crates.ioalloc_geiger
lib.rsalloc_geiger
version0.2.0
sourcesrc
created_at2019-08-13 22:16:11.61938
updated_at2023-11-11 21:18:22.02439
descriptionA Rust allocator which makes sound when active, like a Geiger counter.
homepage
repositoryhttps://github.com/cuviper/alloc_geiger
max_upload_size
id156582
size47,749
Josh Stone (cuviper)

documentation

README

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.2"

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

#[global_allocator]
static ALLOC: alloc_geiger::System = alloc_geiger::SYSTEM;

Alternatives like jemallocator may also be used:

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

#[global_allocator]
static ALLOC: Geiger<Jemalloc> = Geiger::new(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.

Commit count: 8

cargo fmt