1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:27:35 +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

@ -9,7 +9,7 @@
class PageDirectory : public Retainable<PageDirectory> {
friend class MemoryManager;
public:
static Retained<PageDirectory> create_for_userspace() { return adopt(*new PageDirectory); }
static Retained<PageDirectory> create_for_userspace(const RangeAllocator* parent_range_allocator = nullptr) { return adopt(*new PageDirectory(parent_range_allocator)); }
static Retained<PageDirectory> create_at_fixed_address(PhysicalAddress paddr) { return adopt(*new PageDirectory(paddr)); }
~PageDirectory();
@ -21,7 +21,7 @@ public:
RangeAllocator& range_allocator() { return m_range_allocator; }
private:
PageDirectory();
explicit PageDirectory(const RangeAllocator* parent_range_allocator);
explicit PageDirectory(PhysicalAddress);
RangeAllocator m_range_allocator;