3
3
//! If the `global_allocator` feature is enabled, the [`Allocator`] will be used
4
4
//! as the global Rust allocator.
5
5
//!
6
- //! # Usage
7
- //!
8
- //! Call the `init` function with a reference to the boot services table.
9
- //! Failure to do so before calling a memory allocating function will panic.
10
- //!
11
- //! Call the `exit_boot_services` function before exiting UEFI boot services.
12
- //! Failure to do so will turn subsequent allocation into undefined behaviour.
6
+ //! This allocator can only be used while boot services are active. If boot
7
+ //! services are not active, `alloc` will return a null pointer, and `dealloc`
8
+ //! will panic.
13
9
14
10
use core:: alloc:: { GlobalAlloc , Layout } ;
15
11
use core:: ptr:: { self , NonNull } ;
@@ -20,18 +16,13 @@ use crate::mem::memory_map::MemoryType;
20
16
use crate :: proto:: loaded_image:: LoadedImage ;
21
17
use crate :: table:: { Boot , SystemTable } ;
22
18
23
- /// Initializes the allocator.
24
- ///
25
- /// # Safety
26
- ///
27
- /// This function is unsafe because you _must_ make sure that exit_boot_services
28
- /// will be called when UEFI boot services will be exited.
29
- #[ allow( unused_unsafe) ]
19
+ /// Deprecated; this function is now a no-op.
20
+ #[ deprecated = "this function is now a no-op" ]
21
+ #[ allow( unused_unsafe, clippy:: missing_safety_doc) ]
30
22
pub unsafe fn init ( _: & mut SystemTable < Boot > ) { }
31
23
32
- /// Notify the allocator library that boot services are not safe to call anymore
33
- ///
34
- /// You must arrange for this function to be called on exit from UEFI boot services
24
+ /// Deprecated; this function is now a no-op.
25
+ #[ deprecated = "this function is now a no-op" ]
35
26
#[ allow( clippy:: missing_const_for_fn) ]
36
27
pub fn exit_boot_services ( ) { }
37
28
0 commit comments