mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 21:15:06 +00:00
Kernel: Remove ContiguousVMObject, let AnonymousVMObject do the job
We don't need an entirely separate VMObject subclass to influence the location of the physical pages. Instead, we simply allocate enough physically contiguous memory first, and then pass it to the AnonymousVMObject constructor that takes a span of physical pages.
This commit is contained in:
parent
9a701eafc4
commit
6a537ceef1
10 changed files with 18 additions and 89 deletions
|
@ -70,6 +70,14 @@ RefPtr<AnonymousVMObject> AnonymousVMObject::try_create_with_size(size_t size, A
|
|||
return adopt_ref_if_nonnull(new (nothrow) AnonymousVMObject(size, commit));
|
||||
}
|
||||
|
||||
RefPtr<AnonymousVMObject> AnonymousVMObject::try_create_physically_contiguous_with_size(size_t size)
|
||||
{
|
||||
auto contiguous_physical_pages = MM.allocate_contiguous_supervisor_physical_pages(size);
|
||||
if (contiguous_physical_pages.is_empty())
|
||||
return {};
|
||||
return adopt_ref_if_nonnull(new (nothrow) AnonymousVMObject(contiguous_physical_pages.span()));
|
||||
}
|
||||
|
||||
RefPtr<AnonymousVMObject> AnonymousVMObject::try_create_purgeable_with_size(size_t size, AllocationStrategy commit)
|
||||
{
|
||||
if (commit == AllocationStrategy::Reserve || commit == AllocationStrategy::AllocateNow) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue