1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

Kernel: Use NonnullRefPtrVector<T> instead of Vector<RefPtr<T>> some

This commit is contained in:
Andreas Kling 2020-05-08 20:15:01 +02:00
parent bd12f132f3
commit d74650e80d
4 changed files with 9 additions and 11 deletions

View file

@ -64,19 +64,18 @@ unsigned PhysicalRegion::finalize_capacity()
return size();
}
Vector<RefPtr<PhysicalPage>> PhysicalRegion::take_contiguous_free_pages(size_t count, bool supervisor)
NonnullRefPtrVector<PhysicalPage> PhysicalRegion::take_contiguous_free_pages(size_t count, bool supervisor)
{
ASSERT(m_pages);
ASSERT(m_used != m_pages);
Vector<RefPtr<PhysicalPage>> physical_pages;
NonnullRefPtrVector<PhysicalPage> physical_pages;
physical_pages.ensure_capacity(count);
auto first_contiguous_page = find_contiguous_free_pages(count);
for (size_t index = 0; index < count; index++) {
for (size_t index = 0; index < count; index++)
physical_pages.append(PhysicalPage::create(m_lower.offset(PAGE_SIZE * (index + first_contiguous_page)), supervisor));
}
return physical_pages;
}