1 个不稳定版本
0.1.0 | 2024年5月24日 |
---|---|
0.0.0 |
|
#459 在 并发
每月32次下载
29KB
508 行
对象池
特性
- 无锁,由并发安全队列支持。
- 内置引用计数器,无需
Arc
包装器。 - 简单的 API 和支持
no_std
环境。 - 自动将对象放回池中。
安装
-
std
[dependencies] objectpool = "0.1"
-
no_std
[dependencies] objectpool = { version = "0.1", default-features = false, features = ["alloc"] }
测试
-
test
:cargo test
-
miri
:cargo miri test
-
loom
:cargo test --tests --features loom
基准测试
对于详细报告,您可以在最新的基准 GitHub Action 中查看,并下载工件。
cargo bench
为什么选择这个 crate?
我需要一个支持 no_std
环境的对象池。不幸的是,object-pool
、lockfree-object-pool
和 sharded-slab
都不支持 no_std
。
许可证
objectpool
适用于 MIT 许可证和 Apache 许可证(版本 2.0)的条款。
有关详细信息,请参阅 LICENSE-APACHE 和 LICENSE-MIT。
版权所有 (c) 2024 Al Liu。
依赖项
~0.1–25MB
~335K SLoC