|
4 | 4 | //! exports an `Allocator` type that wraps a System-Table together with a UEFI memory type and
|
5 | 5 | //! forwards memory requests to the UEFI pool allocator.
|
6 | 6 | //!
|
7 |
| -//! The allocator implements the `core::alloc::AllocRef` API defined by the rust standard library. |
| 7 | +//! The allocator implements the `core::alloc::Allocator` API defined by the rust standard library. |
8 | 8 | //! Apart from the constructors, no private extensions are defined. For documentation on the
|
9 | 9 | //! allocation-API, see the rust standard library.
|
10 | 10 | //!
|
11 |
| -//! Note that `core::alloc::AllocRef` is marked unstable as of time of this crate-release. That |
| 11 | +//! Note that `core::alloc::Allocator` is marked unstable as of time of this crate-release. That |
12 | 12 | //! is, future versions of this trait definition might be incompatible to the current version.
|
13 | 13 | //! Make sure you use a crate-version that matches your standard-library.
|
14 | 14 |
|
@@ -92,7 +92,7 @@ unsafe fn unalign_block(ptr: *mut u8, align: usize) -> *mut u8 {
|
92 | 92 | /// allocator. It takes a System-Table as input, as well as the memory type to use as backing, and
|
93 | 93 | /// then forwards all memory allocation requests to the `AllocatePool()` UEFI system.
|
94 | 94 | ///
|
95 |
| -/// The `core::alloc::AllocRef` trait is implemented for this allocator. Hence, this allocator can |
| 95 | +/// The `core::alloc::Allocator` trait is implemented for this allocator. Hence, this allocator can |
96 | 96 | /// also be used to back the global memory-allocator of `liballoc` (or `libstd`). See the `Global`
|
97 | 97 | /// type for an implementation of the global allocator.
|
98 | 98 | pub struct Allocator {
|
@@ -124,8 +124,8 @@ impl Allocator {
|
124 | 124 | }
|
125 | 125 | }
|
126 | 126 |
|
127 |
| -unsafe impl core::alloc::AllocRef for Allocator { |
128 |
| - fn alloc( |
| 127 | +unsafe impl core::alloc::Allocator for Allocator { |
| 128 | + fn allocate( |
129 | 129 | &self,
|
130 | 130 | layout: core::alloc::Layout,
|
131 | 131 | ) -> Result<core::ptr::NonNull<[u8]>, core::alloc::AllocError> {
|
@@ -165,7 +165,7 @@ unsafe impl core::alloc::AllocRef for Allocator {
|
165 | 165 | ).unwrap())
|
166 | 166 | }
|
167 | 167 |
|
168 |
| - unsafe fn dealloc(&self, ptr: core::ptr::NonNull<u8>, layout: core::alloc::Layout) { |
| 168 | + unsafe fn deallocate(&self, ptr: core::ptr::NonNull<u8>, layout: core::alloc::Layout) { |
169 | 169 | if layout.size() != 0 {
|
170 | 170 | // The spec allows returning errors from `FreePool()`. However, it
|
171 | 171 | // must serve any valid requests. Only `INVALID_PARAMETER` is
|
|
0 commit comments