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

Kernel: Fix regression where MemoryManager is initialized twice

MemoryManager cannot use the Singleton class because
MemoryManager::initialize is called before the global constructors
are run. That caused the Singleton to be re-initialized, causing
it to create another MemoryManager instance.
This commit is contained in:
Tom 2020-08-21 11:00:51 -06:00 committed by Andreas Kling
parent f0906250a1
commit 8a75e0b892
2 changed files with 7 additions and 6 deletions

View file

@ -85,7 +85,6 @@ class MemoryManager {
friend Optional<KBuffer> procfs$memstat(InodeIdentifier);
public:
MemoryManager();
static MemoryManager& the();
static void initialize(u32 cpu);
@ -161,6 +160,7 @@ public:
PageDirectory& kernel_page_directory() { return *m_kernel_page_directory; }
private:
MemoryManager();
~MemoryManager();
enum class AccessSpace { Kernel,