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

Kernel: Make AnonymousVMObject COW-Bitmap allocation OOM-fallible

This commit is contained in:
Idan Horowitz 2022-02-10 19:17:27 +02:00
parent 871a53db76
commit 8030e2a88f
5 changed files with 35 additions and 21 deletions

View file

@ -178,11 +178,12 @@ bool Region::should_cow(size_t page_index) const
return static_cast<AnonymousVMObject const&>(vmobject()).should_cow(first_page_index() + page_index, m_shared);
}
void Region::set_should_cow(size_t page_index, bool cow)
ErrorOr<void> Region::set_should_cow(size_t page_index, bool cow)
{
VERIFY(!m_shared);
if (vmobject().is_anonymous())
static_cast<AnonymousVMObject&>(vmobject()).set_should_cow(first_page_index() + page_index, cow);
TRY(static_cast<AnonymousVMObject&>(vmobject()).set_should_cow(first_page_index() + page_index, cow));
return {};
}
bool Region::map_individual_page_impl(size_t page_index)