File tree 3 files changed +9
-6
lines changed
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 4
4
5
5
### Changed
6
6
7
- - The ` uefi::global_allocator ` module has been renamed to ` uefi::allocator ` .
7
+ - The ` global_allocator ` module has been renamed to ` allocator ` , and is now
8
+ available regardless of whether the ` global_allocator ` feature is enabled. The
9
+ ` global_allocator ` feature now only controls whether ` allocator::Allocator ` is
10
+ set as Rust's global allocator.
8
11
9
12
## uefi-macros - [ Unreleased]
10
13
Original file line number Diff line number Diff line change 1
1
//! This module implements Rust's global allocator interface using UEFI's memory allocation functions.
2
2
//!
3
- //! Enabling the `alloc` optional feature in your app will allow you to use Rust's higher-level data structures,
4
- //! like boxes, vectors, hash maps, linked lists and so on .
3
+ //! If the `global_allocator` feature is enabled, the [`Allocator`] will be used
4
+ //! as the global Rust allocator .
5
5
//!
6
6
//! # Usage
7
7
//!
@@ -112,5 +112,6 @@ unsafe impl GlobalAlloc for Allocator {
112
112
}
113
113
}
114
114
115
+ #[ cfg( feature = "global_allocator" ) ]
115
116
#[ global_allocator]
116
117
static ALLOCATOR : Allocator = Allocator ;
Original file line number Diff line number Diff line change 43
43
//! `Vec` rather than filling a statically-sized array. This requires
44
44
//! a global allocator; you can use the `global_allocator` feature or
45
45
//! provide your own.
46
- //! - `global_allocator`: Implement a [global allocator] using UEFI
47
- //! functions . This is a simple allocator that relies on the UEFI pool
46
+ //! - `global_allocator`: Set [` allocator::Allocator`] as the global Rust
47
+ //! allocator . This is a simple allocator that relies on the UEFI pool
48
48
//! allocator. You can choose to provide your own allocator instead of
49
49
//! using this feature, or no allocator at all if you don't need to
50
50
//! dynamically allocate any memory.
@@ -108,7 +108,6 @@ pub mod proto;
108
108
109
109
pub mod prelude;
110
110
111
- #[ cfg( feature = "global_allocator" ) ]
112
111
pub mod allocator;
113
112
114
113
#[ cfg( feature = "logger" ) ]
You can’t perform that action at this time.
0 commit comments