Skip to content

Commit cd573f9

Browse files
chore: for cargo publish
1 parent 922e72a commit cd573f9

File tree

4 files changed

+50
-8
lines changed

4 files changed

+50
-8
lines changed

Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[package]
2-
name = "allocator"
3-
version = "0.1.2"
2+
name = "axallocator"
3+
version = "0.1.3-preview.1"
44
edition = "2021"
5-
authors = ["Yuekai Jia <equation618@gmail.com>"]
5+
authors = ["Yuekai Jia <equation618@gmail.com>", "Yu Chen <yuchen@tsinghua.edu.cn>"]
66
description = "Various allocator algorithms in a unified interface"
77
license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0"
88
homepage = "https://github.com/arceos-org/arceos"
99
repository = "https://github.com/arceos-org/allocator"
1010
documentation = "https://arceos-org.github.io/allocator"
11+
readme = "README.md"
1112

1213
[features]
1314
default = ["page-alloc-256m"]
@@ -16,7 +17,7 @@ full = ["bitmap", "tlsf", "slab", "buddy", "allocator_api", "page-alloc-256m"]
1617
bitmap = ["dep:bitmap-allocator"]
1718

1819
tlsf = ["dep:rlsf"]
19-
slab = ["dep:slab_allocator"]
20+
slab = ["dep:ax_slab_allocator"]
2021
buddy = ["dep:buddy_system_allocator"]
2122

2223
allocator_api = []
@@ -33,11 +34,11 @@ axerrno = { version = "0.1", optional = true }
3334
cfg-if = "1.0"
3435
rlsf = { version = "0.2", optional = true }
3536
buddy_system_allocator = { version = "0.10", default-features = false, optional = true }
36-
slab_allocator = { git = "https://github.com/arceos-org/slab_allocator.git", tag = "v0.3.1", optional = true }
37+
ax_slab_allocator = { version = "0.3.2-preview.1", optional = true }
3738
bitmap-allocator = { version = "0.2", optional = true }
3839

3940
[dev-dependencies]
40-
allocator = { path = ".", features = ["full"] }
41+
axallocator = { path = ".", features = ["full"] }
4142
rand = { version = "0.8", features = ["small_rng"] }
4243
criterion = { version = "0.5", features = ["html_reports"] }
4344

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This crate is licensed under any of:
2+
3+
- GPL-3.0-or-later https://spdx.org/licenses/GPL-3.0-or-later.html
4+
- Apache-2.0 https://spdx.org/licenses/Apache-2.0.html
5+
- MulanPSL-2.0 https://spdx.org/licenses/MulanPSL-2.0.html
6+
7+
at your option.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# axallocator
2+
3+
Various allocator algorithms behind a unified interface for `no_std` environments.
4+
5+
## Allocator types
6+
7+
- **Byte-granularity**: [`BuddyByteAllocator`], [`SlabByteAllocator`], [`TlsfByteAllocator`]
8+
- **Page-granularity**: [`BitmapPageAllocator`]
9+
- **ID allocator**: [`IdAllocator`]
10+
11+
## Features
12+
13+
| Feature | Description |
14+
|----------------|--------------------------------|
15+
| `bitmap` | Bitmap-based page allocator |
16+
| `tlsf` | TLSF byte allocator |
17+
| `slab` | Slab byte allocator (uses `ax_slab_allocator`) |
18+
| `buddy` | Buddy byte allocator |
19+
| `allocator_api`| Implement `Allocator` (nightly)|
20+
| `page-alloc-*` | Page size / range (e.g. `page-alloc-256m`) |
21+
| `axerrno` | `AxError` integration |
22+
23+
Default: `page-alloc-256m`. Use `full` for all allocators and `allocator_api`.
24+
25+
## Usage
26+
27+
```toml
28+
[dependencies]
29+
axallocator = { version = "0.1", features = ["slab", "buddy"] }
30+
```
31+
32+
## License
33+
34+
GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0. See [LICENSE](LICENSE).

src/slab.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use super::{AllocError, AllocResult, BaseAllocator, ByteAllocator};
66
use core::alloc::Layout;
77
use core::ptr::NonNull;
8-
use slab_allocator::Heap;
8+
use ax_slab_allocator::Heap;
99

1010
/// A byte-granularity memory allocator based on the [slab allocator].
1111
///
12-
/// [slab allocator]: ../slab_allocator/index.html
12+
/// [slab allocator]: https://docs.rs/ax_slab_allocator
1313
pub struct SlabByteAllocator {
1414
inner: Option<Heap>,
1515
}

0 commit comments

Comments
 (0)