1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

Kernel: Remove double RedBlackTree lookup in VM/Space region removal

We should never request a regions removal that we don't currently
own. We currently assert this everywhere else by all callers.

Instead lets just push the assert down into the RedBlackTree removal
and assume that we will always successfully remove the region.
This commit is contained in:
Brian Gianforcaro 2021-07-17 06:07:02 -07:00 committed by Andreas Kling
parent d879709ec7
commit c0987453e6
4 changed files with 13 additions and 26 deletions

View file

@ -404,9 +404,7 @@ void Thread::exit(void* exit_value)
[[maybe_unused]] auto rc = unlock_process_if_locked(unlock_count);
if (m_thread_specific_range.has_value()) {
auto* region = process().space().find_region_from_range(m_thread_specific_range.value());
VERIFY(region);
if (!process().space().deallocate_region(*region))
dbgln("Failed to unmap TLS range, exiting thread anyway.");
process().space().deallocate_region(*region);
}
die_if_needed();
}