From 1f8f739ea2d26b30f9ef6ae9ee272ea5fae035fa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 24 Jul 2019 06:29:47 +0200 Subject: [PATCH] Kernel: Simplify PhysicalPage construction. There was some leftover cruft from the times when PhysicalPage was allocated using different allocators depending on lifetime. --- Kernel/VM/PhysicalPage.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Kernel/VM/PhysicalPage.cpp b/Kernel/VM/PhysicalPage.cpp index 49436a22af..654caff7d5 100644 --- a/Kernel/VM/PhysicalPage.cpp +++ b/Kernel/VM/PhysicalPage.cpp @@ -4,9 +4,7 @@ NonnullRefPtr PhysicalPage::create(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist) { - void* slot = kmalloc(sizeof(PhysicalPage)); - new (slot) PhysicalPage(paddr, supervisor, may_return_to_freelist); - return adopt(*(PhysicalPage*)slot); + return adopt(*new PhysicalPage(paddr, supervisor, may_return_to_freelist)); } PhysicalPage::PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist)