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
commit 52cbbe1dc5
Notes: sideshowbarker 2024-07-18 04:39:07 +09:00

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();