1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

Kernel: Implement a simple virtual address range allocator.

This replaces the previous virtual address allocator which was basically
just "m_next_address += size;"

With this in place, virtual addresses can get reused, which cuts down on
the number of page tables created. When we implement ASLR some day, we'll
probably have to do page table deallocation, but for now page tables are
only deallocated once the process dies.
This commit is contained in:
Andreas Kling 2019-05-17 03:40:15 +02:00
parent c56e3ebee1
commit c414e65498
5 changed files with 231 additions and 22 deletions

View file

@ -7,10 +7,10 @@
#include <AK/WeakPtr.h>
#include <AK/Weakable.h>
#include <Kernel/FileSystem/VirtualFileSystem.h>
#include <Kernel/VM/RangeAllocator.h>
#include <Kernel/TTY/TTY.h>
#include <Kernel/Syscall.h>
#include <Kernel/UnixTypes.h>
#include <Kernel/Thread.h>
#include <Kernel/Lock.h>
@ -331,6 +331,7 @@ private:
RetainPtr<ProcessTracer> m_tracer;
OwnPtr<ELFLoader> m_elf_loader;
RangeAllocator m_range_allocator;
Lock m_big_lock { "Process" };
};