Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## Upcoming version

### Added

- Support for no_std environments.

### Changed
### Fixed
### Removed
Expand Down
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ keywords = ["resources", "allocation", "address", "virt"]
license = "Apache-2.0 OR BSD-3-Clause"
edition = "2018"

[features]
default = ["std"]
std = []

[dependencies]
libc = "0.2.39"
thiserror = "2.0"
thiserror = {version= "2.0", default-features = false}
serde = { version = "1.0.137", optional = true, features = ["derive"] }
2 changes: 2 additions & 0 deletions src/allocation_engine/interval_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use std::cmp::{max, Ordering};

use alloc::boxed::Box;

use crate::{AllocPolicy, Constraint, Error, RangeInclusive, Result};

/// Returns the first multiple of `alignment` that is lower or equal to the
Expand Down
2 changes: 1 addition & 1 deletion src/id_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! that can be abstracted to an integer.

use crate::{Error, Result};
use std::collections::BTreeSet;
use alloc::collections::BTreeSet;

/// An unique ID allocator that allows management of IDs in a given interval.
// Internal representation of IdAllocator. Contains the ends of the interval
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
//! ```

#![deny(missing_docs)]
#![cfg_attr(not(feature = "std"), no_std)]

extern crate alloc;

#[cfg(not(feature = "std"))]
extern crate core as std;

mod address_allocator;
/// Allocation engine used by address allocator.
Expand Down