mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 00:38:48 +00:00
Kernel: Make InodeVMOBject construction OOM-aware
This commit moves the allocation of the resources required for InodeVMObject 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:
parent
3879e70447
commit
ad480ff18b
Notes:
sideshowbarker
2024-07-17 20:50:14 +09:00
Author: https://github.com/creator1creeper1
Commit: ad480ff18b
Pull-request: https://github.com/SerenityOS/serenity/pull/11843
Reviewed-by: https://github.com/IdanHo ✅
Reviewed-by: https://github.com/bgianfo
4 changed files with 10 additions and 10 deletions
|
@ -9,15 +9,15 @@
|
|||
|
||||
namespace Kernel::Memory {
|
||||
|
||||
InodeVMObject::InodeVMObject(Inode& inode, size_t size)
|
||||
: VMObject(VMObject::must_create_physical_pages_but_fixme_should_propagate_errors(size))
|
||||
InodeVMObject::InodeVMObject(Inode& inode, FixedArray<RefPtr<PhysicalPage>>&& new_physical_pages)
|
||||
: VMObject(move(new_physical_pages))
|
||||
, m_inode(inode)
|
||||
, m_dirty_pages(page_count(), false)
|
||||
{
|
||||
}
|
||||
|
||||
InodeVMObject::InodeVMObject(InodeVMObject const& other)
|
||||
: VMObject(other.must_clone_physical_pages_but_fixme_should_propagate_errors())
|
||||
InodeVMObject::InodeVMObject(InodeVMObject const& other, FixedArray<RefPtr<PhysicalPage>>&& new_physical_pages)
|
||||
: VMObject(move(new_physical_pages))
|
||||
, m_inode(other.m_inode)
|
||||
, m_dirty_pages(page_count(), false)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue