1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

Kernel: Actually share committed CoW pages

Due to a double-move mistake, we were always clearing the shared
committed CoW pages in the parent when forking.
This commit is contained in:
Andreas Kling 2021-09-05 22:25:37 +02:00
parent 2f790cf78f
commit 52cbbe1dc5

View file

@ -46,7 +46,7 @@ KResultOr<NonnullRefPtr<VMObject>> AnonymousVMObject::try_clone()
if (!new_shared_committed_cow_pages)
return ENOMEM;
auto maybe_clone = adopt_ref_if_nonnull(new (nothrow) AnonymousVMObject(*this, new_shared_committed_cow_pages.release_nonnull()));
auto maybe_clone = adopt_ref_if_nonnull(new (nothrow) AnonymousVMObject(*this, *new_shared_committed_cow_pages));
if (!maybe_clone)
return ENOMEM;
auto clone = maybe_clone.release_nonnull();