8000 boot: Always impl Drop for MemoryMapBackingMemory by nicholasbishop · Pull Request #1248 · rust-osdev/uefi-rs · GitHub
[go: up one dir, main page]

Skip to content

boot: Always impl Drop for MemoryMapBackingMemory #1248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
boot: Always impl Drop for MemoryMapBackingMemory
Gating this on `cfg(not(test))` isn't necessary; during unit tests
`system_table_boot()` will return `None` and so the drop won't do anything
anyway.

Also fix a typo, excited -> exited.
  • Loading branch information
nicholasbishop committed Jul 17, 2024
commit ccf9897101a566552220947e2742a0dba9354150
4 changes: 1 addition & 3 deletions uefi/src/table/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1737,8 +1737,6 @@ impl MemoryMapBackingMemory {
}
}

// Don't drop when we use this in unit tests.
#[cfg(not(test))]
impl Drop for MemoryMapBackingMemory {
fn drop(&mut self) {
if let Some(bs) = system_table_boot() {
Expand All @@ -1747,7 +1745,7 @@ impl Drop for MemoryMapBackingMemory {
log::error!("Failed to deallocate memory map: {e:?}");
}
} else {
log::debug!("Boot services are excited. Memory map won't be freed using the UEFI boot services allocator.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boot services are excited

🤣

log::debug!("Boot services are exited. Memory map won't be freed using the UEFI boot services allocator.");
}
}
}
Expand Down
0