#分配器 #计数器 #声音 #活跃 #rodio #geiger #sinc

alloc_geiger

一个在活跃时发出声音的Rust分配器,类似于盖革计数器

3个不稳定版本

0.2.0 2023年11月11日
0.1.1 2019年8月13日
0.1.0 2019年8月13日

#232 in 内存管理

MIT/Apache

15KB
164

alloc_geiger

Latest Version docs

一个在活跃时发出声音的Rust分配器,类似于盖革计数器。

使用rodio库在每次使用分配器时发出sinc脉冲,不包括其自身的分配器活动。

Malloc Geiger启发。

用法

要使用alloc_geiger,请将其作为依赖项添加

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

要将alloc_geiger::Geiger设置为全局分配器,它必须使用基本分配器初始化。类型别名type System及其const SYSTEM使其易于使用默认的系统分配器

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

类似jemallocator的替代方案也可以使用

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

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

许可

本项目许可为以下之一

由你选择。

贡献

除非你明确声明,否则你提交给alloc_geiger的任何贡献,按照Apache-2.0许可的规定,应以上述双重许可方式提供,不附加任何额外的条款或条件。

依赖

~0.7–30MB
~442K SLoC