mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-21 02:22:51 +00:00
Kernel: Set up Regions before adding them to a Process's AddressSpace
This reduces the amount of time in which not fully-initialized Regions are present inside an AddressSpace's region tree.
This commit is contained in:
parent
d9d3362722
commit
57bce8ab97
Notes:
sideshowbarker
2024-07-17 19:01:40 +09:00
Author: https://github.com/IdanHo
Commit: 57bce8ab97
Pull-request: https://github.com/SerenityOS/serenity/pull/12422
2 changed files with 10 additions and 12 deletions
|
@ -106,8 +106,8 @@ ErrorOr<FlatPtr> Process::sys$fork(RegisterState& regs)
|
|||
for (auto& region : address_space().regions()) {
|
||||
dbgln_if(FORK_DEBUG, "fork: cloning Region({}) '{}' @ {}", region, region->name(), region->vaddr());
|
||||
auto region_clone = TRY(region->try_clone());
|
||||
TRY(region_clone->map(child->address_space().page_directory(), Memory::ShouldFlushTLB::No));
|
||||
auto* child_region = TRY(child->address_space().add_region(move(region_clone)));
|
||||
TRY(child_region->map(child->address_space().page_directory(), Memory::ShouldFlushTLB::No));
|
||||
|
||||
if (region == m_master_tls_region.unsafe_ptr())
|
||||
child->m_master_tls_region = child_region;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue