mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:42:13 +00:00
Kernel: Make Kernel::VMObject allocation functions return KResultOr
This makes for nicer handling of errors compared to checking whether a RefPtr is null. Additionally, this will give way to return different types of errors in the future.
This commit is contained in:
parent
61c0e3ca92
commit
4bfd6e41b9
26 changed files with 194 additions and 122 deletions
|
@ -18,12 +18,12 @@ class AnonymousVMObject final : public VMObject {
|
|||
public:
|
||||
virtual ~AnonymousVMObject() override;
|
||||
|
||||
static RefPtr<AnonymousVMObject> try_create_with_size(size_t, AllocationStrategy);
|
||||
static RefPtr<AnonymousVMObject> try_create_for_physical_range(PhysicalAddress paddr, size_t size);
|
||||
static RefPtr<AnonymousVMObject> try_create_with_physical_pages(Span<NonnullRefPtr<PhysicalPage>>);
|
||||
static RefPtr<AnonymousVMObject> try_create_purgeable_with_size(size_t, AllocationStrategy);
|
||||
static RefPtr<AnonymousVMObject> try_create_physically_contiguous_with_size(size_t);
|
||||
virtual RefPtr<VMObject> try_clone() override;
|
||||
static KResultOr<NonnullRefPtr<AnonymousVMObject>> try_create_with_size(size_t, AllocationStrategy);
|
||||
static KResultOr<NonnullRefPtr<AnonymousVMObject>> try_create_for_physical_range(PhysicalAddress paddr, size_t size);
|
||||
static KResultOr<NonnullRefPtr<AnonymousVMObject>> try_create_with_physical_pages(Span<NonnullRefPtr<PhysicalPage>>);
|
||||
static KResultOr<NonnullRefPtr<AnonymousVMObject>> try_create_purgeable_with_size(size_t, AllocationStrategy);
|
||||
static KResultOr<NonnullRefPtr<AnonymousVMObject>> try_create_physically_contiguous_with_size(size_t);
|
||||
virtual KResultOr<NonnullRefPtr<VMObject>> try_clone() override;
|
||||
|
||||
[[nodiscard]] NonnullRefPtr<PhysicalPage> allocate_committed_page(Badge<Region>);
|
||||
PageFaultResponse handle_cow_fault(size_t, VirtualAddress);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue