mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 03:57:15 +02:00
Kernel: Make VMOBject construction OOM-aware
This commit moves the allocation of the resources required for VMObject from its constructors to the constructors of its child classes. We're making this change to give the child classes the chance to expose the fallibility of the allocation.
This commit is contained in:
committed by
Idan Horowitz
parent
64778f9e69
commit
d1f265e851
Notes:
sideshowbarker
2024-07-17 20:50:21 +09:00
Author: https://github.com/creator1creeper1 Commit: https://github.com/SerenityOS/serenity/commit/d1f265e8517 Pull-request: https://github.com/SerenityOS/serenity/pull/11843 Reviewed-by: https://github.com/IdanHo ✅ Reviewed-by: https://github.com/bgianfo
@@ -10,14 +10,14 @@
|
||||
namespace Kernel::Memory {
|
||||
|
||||
InodeVMObject::InodeVMObject(Inode& inode, size_t size)
|
||||
: VMObject(size)
|
||||
: VMObject(VMObject::must_create_physical_pages_but_fixme_should_propagate_errors(size))
|
||||
, m_inode(inode)
|
||||
, m_dirty_pages(page_count(), false)
|
||||
{
|
||||
}
|
||||
|
||||
InodeVMObject::InodeVMObject(InodeVMObject const& other)
|
||||
: VMObject(other)
|
||||
: VMObject(other.must_clone_physical_pages_but_fixme_should_propagate_errors())
|
||||
, m_inode(other.m_inode)
|
||||
, m_dirty_pages(page_count(), false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user