mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:18:12 +00:00
Kernel: Make AnonymousVMObject COW-Bitmap allocation OOM-fallible
This commit is contained in:
parent
871a53db76
commit
8030e2a88f
5 changed files with 35 additions and 21 deletions
|
@ -29,7 +29,7 @@ public:
|
|||
PageFaultResponse handle_cow_fault(size_t, VirtualAddress);
|
||||
size_t cow_pages() const;
|
||||
bool should_cow(size_t page_index, bool) const;
|
||||
void set_should_cow(size_t page_index, bool);
|
||||
ErrorOr<void> set_should_cow(size_t page_index, bool);
|
||||
|
||||
bool is_purgeable() const { return m_purgeable; }
|
||||
bool is_volatile() const { return m_volatile; }
|
||||
|
@ -41,6 +41,8 @@ public:
|
|||
private:
|
||||
class SharedCommittedCowPages;
|
||||
|
||||
static ErrorOr<NonnullRefPtr<AnonymousVMObject>> try_create_with_shared_cow(AnonymousVMObject const&, NonnullRefPtr<SharedCommittedCowPages>, FixedArray<RefPtr<PhysicalPage>>&&);
|
||||
|
||||
explicit AnonymousVMObject(FixedArray<RefPtr<PhysicalPage>>&&, AllocationStrategy, Optional<CommittedPhysicalPageSet>);
|
||||
explicit AnonymousVMObject(PhysicalAddress, FixedArray<RefPtr<PhysicalPage>>&&);
|
||||
explicit AnonymousVMObject(FixedArray<RefPtr<PhysicalPage>>&&);
|
||||
|
@ -54,8 +56,8 @@ private:
|
|||
|
||||
virtual bool is_anonymous() const override { return true; }
|
||||
|
||||
Bitmap& ensure_cow_map();
|
||||
void ensure_or_reset_cow_map();
|
||||
ErrorOr<void> ensure_cow_map();
|
||||
ErrorOr<void> ensure_or_reset_cow_map();
|
||||
|
||||
Optional<CommittedPhysicalPageSet> m_unused_committed_pages;
|
||||
Bitmap m_cow_map;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue