From 1ea7ba7f28b0f6acda458a449593da0a3db12811 Mon Sep 17 00:00:00 2001 From: Al Liu Date: Fri, 24 May 2024 22:04:50 +0800 Subject: [PATCH] Cleanup --- Cargo.toml | 10 ++++++---- README-zh_CN.md | 35 +++++++++++++++++++++++++++++++---- README.md | 37 ++++++++++++++++++++++++++++++++----- src/lib.rs | 2 +- 4 files changed, 70 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ba922ae..3ec7abf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,15 @@ [package] name = "objectpool" -version = "0.0.0" +version = "0.1.0" edition = "2021" repository = "https://github.com/al8n/objectpool" homepage = "https://github.com/al8n/objectpool" documentation = "https://docs.rs/objectpool" -description = "Yet another lock-free object pool" -license = "MIT/Apache-2.0" +description = "Yet another lock-free object pool, support no_std" +license = "MIT OR Apache-2.0" rust-version = "1.56" +keywords = ["atomic", "object-pool", "lockfree-object-pool", "non-blocking", "lock-free"] +categories = ["concurrency", "memory-management", "data-structures", "development-tools", "no-std"] [[bench]] path = "benches/bench.rs" @@ -25,7 +27,7 @@ crossbeam-queue = { version = "0.3", default-features = false } loom = { version = "0.7", optional = true } [dev-dependencies] -criterion = "0.5" +criterion = "0.5.1" sharded-slab = "0.1" object-pool = "0.5" criterion-plot = "0.5" diff --git a/README-zh_CN.md b/README-zh_CN.md index 1cfa428..b30c7f3 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -6,26 +6,53 @@ Yet another lock-free object pool. [github][Github-url] +LoC [Build][CI-url] [codecov][codecov-url] [docs.rs][doc-url] -[crates.io][crates-url] -[crates.io][crates-url] - +[crates.io][crates-url] +[crates.io][crates-url] license English | [简体中文][zh-cn-url] +## Features + +- Lock free, backed by concurrent safe queue. +- Unlike other object pool implementation in Rust, get always return an owned struct, do not need to handle lifetime. +- Builtin reference counter, no `Arc` wrapper required. +- Simple APIs and support `no_std` environment. + ## Installation ```toml [dependencies] -objectpool = "0.0.0" +objectpool = "0.1.0" ``` +## Tests + +- `test`: + + ```sh + cargo test + ``` + +- `miri`: + + ```sh + cargo miri test + ``` + +- `loom`: + + ```sh + cargo test --features loom + ``` + #### License `objectpool` is under the terms of both the MIT license and the diff --git a/README.md b/README.md index 1066a37..b30c7f3 100644 --- a/README.md +++ b/README.md @@ -3,29 +3,56 @@
-WIP: Yet another lock-free object pool. +Yet another lock-free object pool. [github][Github-url] +LoC [Build][CI-url] [codecov][codecov-url] [docs.rs][doc-url] -[crates.io][crates-url] -[crates.io][crates-url] - +[crates.io][crates-url] +[crates.io][crates-url] license English | [简体中文][zh-cn-url]
+## Features + +- Lock free, backed by concurrent safe queue. +- Unlike other object pool implementation in Rust, get always return an owned struct, do not need to handle lifetime. +- Builtin reference counter, no `Arc` wrapper required. +- Simple APIs and support `no_std` environment. + ## Installation ```toml [dependencies] -objectpool = "0.0.0" +objectpool = "0.1.0" ``` +## Tests + +- `test`: + + ```sh + cargo test + ``` + +- `miri`: + + ```sh + cargo miri test + ``` + +- `loom`: + + ```sh + cargo test --features loom + ``` + #### License `objectpool` is under the terms of both the MIT license and the diff --git a/src/lib.rs b/src/lib.rs index fd1ac95..b81a3dd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//! Yet another lock-free object pool. +#![doc = include_str!("../README.md")] #![cfg_attr(not(any(feature = "std", test)), no_std)] #![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, allow(unused_attributes))]