mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
Kernel: Simplify PhysicalPage construction.
There was some leftover cruft from the times when PhysicalPage was allocated using different allocators depending on lifetime.
This commit is contained in:
@@ -4,9 +4,7 @@
|
|||||||
|
|
||||||
NonnullRefPtr<PhysicalPage> PhysicalPage::create(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist)
|
NonnullRefPtr<PhysicalPage> PhysicalPage::create(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist)
|
||||||
{
|
{
|
||||||
void* slot = kmalloc(sizeof(PhysicalPage));
|
return adopt(*new PhysicalPage(paddr, supervisor, may_return_to_freelist));
|
||||||
new (slot) PhysicalPage(paddr, supervisor, may_return_to_freelist);
|
|
||||||
return adopt(*(PhysicalPage*)slot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysicalPage::PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist)
|
PhysicalPage::PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist)
|
||||||
|
|||||||
Reference in New Issue
Block a user