Kernel: Encapsulate the Region's COW map a bit better.

This commit is contained in:
Andreas Kling 2019-05-14 17:31:57 +02:00
commit 01ffcdfa31
Notes: sideshowbarker 2024-07-19 14:08:51 +09:00
5 changed files with 19 additions and 13 deletions

View file

@ -94,8 +94,7 @@ Retained<Region> Region::clone()
laddr().get());
#endif
// Set up a COW region. The parent (this) region becomes COW as well!
for (size_t i = 0; i < page_count(); ++i)
m_cow_map.set(i, true);
m_cow_map.fill(true);
MM.remap_region(current->process().page_directory(), *this);
return adopt(*new Region(laddr(), size(), m_vmo->clone(), m_offset_in_vmo, String(m_name), m_readable, m_writable, true));
}