Skip to content

Commit 67d01ea

Browse files
committed
acpi: add top-level documentation about allocator_api,alloc features
1 parent d5b3381 commit 67d01ea

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

acpi/src/lib.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@
77
//! the `aml` crate, which is the (much less complete) AML parser used to parse the DSDT and SSDTs. These crates
88
//! are separate because some kernels may want to detect the static tables, but delay AML parsing to a later stage.
99
//!
10-
//! TODO: make this correct re alloc features
11-
//! This crate requires `alloc` to make heap allocations. If you are trying to find the RSDP in an environment that
12-
//! does not have a heap (e.g. a bootloader), you can use the `rsdp` crate. The types from that crate are
13-
//! compatible with `acpi`.
10+
//! This crate can be used in three configurations, depending on the environment it's being used from:
11+
//! - **Without allocator support** - this can be achieved by disabling the `allocator_api` and `alloc`
12+
//! features. The core parts of the library will still be usable, but with generally reduced functionality
13+
//! and ease-of-use.
14+
//! - **With a custom allocator** - by disabling just the `alloc` feature, you can use the `new_in` functions to
15+
//! access increased functionality with your own allocator. This allows `acpi` to be integrated more closely
16+
//! with environments that already provide a custom allocator, for example to gracefully handle allocation
17+
//! errors.
18+
//! - **With the globally-set allocator** - the `alloc` feature provides `new` functions that simply use the
19+
//! global allocator. This is the easiest option, and the one the majority of users will want. It is the
20+
//! default configuration of the crate.
1421
//!
1522
//! ### Usage
1623
//! To use the library, you will need to provide an implementation of the `AcpiHandler` trait, which allows the

0 commit comments

Comments
 (0)