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

Kernel: Forked children should inherit their RangeAllocator by copy.

Otherwise we'll start handing out addresses that are very likely already in
use by existing ranges.
This commit is contained in:
Andreas Kling 2019-05-22 13:24:28 +02:00
parent 8098d2e337
commit 7afc0fb9c8
5 changed files with 11 additions and 5 deletions

View file

@ -12,8 +12,8 @@ PageDirectory::PageDirectory(PhysicalAddress paddr)
m_directory_page = PhysicalPage::create_eternal(paddr, true);
}
PageDirectory::PageDirectory()
: m_range_allocator(LinearAddress(userspace_range_base), kernelspace_range_base - userspace_range_base)
PageDirectory::PageDirectory(const RangeAllocator* parent_range_allocator)
: m_range_allocator(parent_range_allocator ? RangeAllocator(*parent_range_allocator) : RangeAllocator(LinearAddress(userspace_range_base), kernelspace_range_base - userspace_range_base))
{
MM.populate_page_directory(*this);
}