File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 2
2
//! as well as relevant helper types, such as [`MemoryMapBackingMemory`].
3
3
4
4
use super :: * ;
5
+ use crate :: boot;
5
6
use crate :: table:: system_table_boot;
6
7
use core:: fmt:: { Debug , Display , Formatter } ;
7
8
use core:: ops:: { Index , IndexMut } ;
@@ -341,8 +342,8 @@ impl MemoryMapBackingMemory {
341
342
// Don't drop when we use this in unit tests.
342
343
impl Drop for MemoryMapBackingMemory {
343
344
fn drop ( & mut self ) {
344
- if let Some ( bs ) = system_table_boot ( ) {
345
- let res = unsafe { bs . boot_services ( ) . free_pool ( self . 0 . as_ptr ( ) . cast ( ) ) } ;
345
+ if boot :: are_boot_services_active ( ) {
346
+ let res = unsafe { boot :: free_pool ( self . 0 . cast ( ) ) } ;
346
347
if let Err ( e) = res {
347
348
log:: error!( "Failed to deallocate memory map: {e:?}" ) ;
348
349
}
You can’t perform that action at this time.
0 commit comments