diff --git a/CHANGELOG.md b/CHANGELOG.md index d3594cf8c..d9914d477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## uefi - [Unreleased] +### Changed + +- The `global_allocator` module has been renamed to `allocator`, and is now + available regardless of whether the `global_allocator` feature is enabled. The + `global_allocator` feature now only controls whether `allocator::Allocator` is + set as Rust's global allocator. + ## uefi-macros - [Unreleased] ## uefi-services - [Unreleased] diff --git a/uefi-services/src/lib.rs b/uefi-services/src/lib.rs index 8e47d5726..2e9e501d6 100644 --- a/uefi-services/src/lib.rs +++ b/uefi-services/src/lib.rs @@ -93,7 +93,7 @@ pub fn init(st: &mut SystemTable) -> Result { init_logger(st); let boot_services = st.boot_services(); - uefi::global_allocator::init(boot_services); + uefi::allocator::init(boot_services); // Schedule these tools to be disabled on exit from UEFI boot services boot_services @@ -191,7 +191,7 @@ unsafe extern "efiapi" fn exit_boot_services(_e: Event, _ctx: Option { /// Once boot services are exited, the logger and allocator provided by /// this crate can no longer be used. The logger should be disabled using /// the [`Logger::disable`] method, and the allocator should be disabled by - /// calling [`global_allocator::exit_boot_services`]. Note that if the logger and + /// calling [`allocator::exit_boot_services`]. Note that if the logger and /// allocator were initialized with [`uefi_services::init`], they will be /// disabled automatically when `exit_boot_services` is called. /// @@ -208,7 +208,7 @@ impl SystemTable { /// now in an undefined state. Rather than returning control to the /// caller, the system will be reset. /// - /// [`global_allocator::exit_boot_services`]: crate::global_allocator::exit_boot_services + /// [`allocator::exit_boot_services`]: crate::allocator::exit_boot_services /// [`Logger::disable`]: crate::logger::Logger::disable /// [`uefi_services::init`]: https://docs.rs/uefi-services/latest/uefi_services/fn.init.html #[must_use]