mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00: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:
parent
64778f9e69
commit
d1f265e851
4 changed files with 30 additions and 13 deletions
|
@ -54,8 +54,11 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
explicit VMObject(size_t);
|
||||
explicit VMObject(VMObject const&);
|
||||
static ErrorOr<FixedArray<RefPtr<PhysicalPage>>> try_create_physical_pages(size_t);
|
||||
static FixedArray<RefPtr<PhysicalPage>> must_create_physical_pages_but_fixme_should_propagate_errors(size_t);
|
||||
ErrorOr<FixedArray<RefPtr<PhysicalPage>>> try_clone_physical_pages() const;
|
||||
FixedArray<RefPtr<PhysicalPage>> must_clone_physical_pages_but_fixme_should_propagate_errors() const;
|
||||
explicit VMObject(FixedArray<RefPtr<PhysicalPage>>&&);
|
||||
|
||||
template<typename Callback>
|
||||
void for_each_region(Callback);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue