mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
Kernel: Make allocate_contiguous_supervisor_physical_pages OOM-fallible
This commit is contained in:
parent
956824afe2
commit
4d2f1a05ec
Notes:
sideshowbarker
2024-07-17 20:05:53 +09:00
Author: https://github.com/IdanHo
Commit: 4d2f1a05ec
Pull-request: https://github.com/SerenityOS/serenity/pull/12179
3 changed files with 7 additions and 16 deletions
|
@ -81,9 +81,7 @@ ErrorOr<NonnullRefPtr<AnonymousVMObject>> AnonymousVMObject::try_create_with_siz
|
|||
|
||||
ErrorOr<NonnullRefPtr<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 ENOMEM;
|
||||
auto contiguous_physical_pages = TRY(MM.allocate_contiguous_supervisor_physical_pages(size));
|
||||
|
||||
auto new_physical_pages = TRY(FixedArray<RefPtr<PhysicalPage>>::try_create(contiguous_physical_pages.span()));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue