diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-21 15:29:31 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-21 15:30:03 +0200 |
commit | 77b9fa89dd36fcd56d956667a956ef7f2ee8f963 (patch) | |
tree | af2cf88f4de319ebc9b0a9a09ecf379b2311e71e /Kernel/VM | |
parent | ef1bfcb9d881ba49cd0e2135375cf4cbb9e85a92 (diff) | |
download | serenity-77b9fa89dd36fcd56d956667a956ef7f2ee8f963.zip |
AK: Rename Retainable => RefCounted.
(And various related renames that go along with it.)
Diffstat (limited to 'Kernel/VM')
-rw-r--r-- | Kernel/VM/MemoryManager.cpp | 2 | ||||
-rw-r--r-- | Kernel/VM/PageDirectory.h | 2 | ||||
-rw-r--r-- | Kernel/VM/PhysicalPage.h | 6 | ||||
-rw-r--r-- | Kernel/VM/PhysicalRegion.h | 2 | ||||
-rw-r--r-- | Kernel/VM/Region.cpp | 2 | ||||
-rw-r--r-- | Kernel/VM/Region.h | 2 | ||||
-rw-r--r-- | Kernel/VM/VMObject.h | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp index d45fcda41f..bcc97d1b35 100644 --- a/Kernel/VM/MemoryManager.cpp +++ b/Kernel/VM/MemoryManager.cpp @@ -324,7 +324,7 @@ bool MemoryManager::copy_on_write(Region& region, unsigned page_index_in_region) { ASSERT_INTERRUPTS_DISABLED(); auto& vmo = region.vmo(); - if (vmo.physical_pages()[page_index_in_region]->retain_count() == 1) { + if (vmo.physical_pages()[page_index_in_region]->ref_count() == 1) { #ifdef PAGE_FAULT_DEBUG dbgprintf(" >> It's a COW page but nobody is sharing it anymore. Remap r/w\n"); #endif diff --git a/Kernel/VM/PageDirectory.h b/Kernel/VM/PageDirectory.h index b4f7ee876e..cf0876e438 100644 --- a/Kernel/VM/PageDirectory.h +++ b/Kernel/VM/PageDirectory.h @@ -6,7 +6,7 @@ #include <Kernel/VM/PhysicalPage.h> #include <Kernel/VM/RangeAllocator.h> -class PageDirectory : public Retainable<PageDirectory> { +class PageDirectory : public RefCounted<PageDirectory> { friend class MemoryManager; public: diff --git a/Kernel/VM/PhysicalPage.h b/Kernel/VM/PhysicalPage.h index 7d5c8c9426..e4422d14a0 100644 --- a/Kernel/VM/PhysicalPage.h +++ b/Kernel/VM/PhysicalPage.h @@ -12,13 +12,13 @@ class PhysicalPage { public: PhysicalAddress paddr() const { return m_paddr; } - void retain() + void ref() { ASSERT(m_retain_count); ++m_retain_count; } - void release() + void deref() { ASSERT(m_retain_count); if (!--m_retain_count) { @@ -30,7 +30,7 @@ public: static Retained<PhysicalPage> create(PhysicalAddress, bool supervisor, bool may_return_to_freelist = true); - word retain_count() const { return m_retain_count; } + word ref_count() const { return m_retain_count; } private: PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist = true); diff --git a/Kernel/VM/PhysicalRegion.h b/Kernel/VM/PhysicalRegion.h index b14b6daf1a..7cecc4b365 100644 --- a/Kernel/VM/PhysicalRegion.h +++ b/Kernel/VM/PhysicalRegion.h @@ -6,7 +6,7 @@ #include <Kernel/PhysicalAddress.h> #include <Kernel/VM/PhysicalPage.h> -class PhysicalRegion : public Retainable<PhysicalRegion> { +class PhysicalRegion : public RefCounted<PhysicalRegion> { AK_MAKE_ETERNAL public: diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp index d3cfd0c655..234fc4710b 100644 --- a/Kernel/VM/Region.cpp +++ b/Kernel/VM/Region.cpp @@ -129,7 +129,7 @@ size_t Region::amount_shared() const size_t bytes = 0; for (size_t i = 0; i < page_count(); ++i) { auto& physical_page = m_vmo->physical_pages()[first_page_index() + i]; - if (physical_page && physical_page->retain_count() > 1) + if (physical_page && physical_page->ref_count() > 1) bytes += PAGE_SIZE; } return bytes; diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h index ef094bc0b6..1e0d374b17 100644 --- a/Kernel/VM/Region.h +++ b/Kernel/VM/Region.h @@ -8,7 +8,7 @@ class Inode; class VMObject; -class Region : public Retainable<Region> { +class Region : public RefCounted<Region> { friend class MemoryManager; public: diff --git a/Kernel/VM/VMObject.h b/Kernel/VM/VMObject.h index 6d69ac06ec..5713d54395 100644 --- a/Kernel/VM/VMObject.h +++ b/Kernel/VM/VMObject.h @@ -13,7 +13,7 @@ class Inode; class PhysicalPage; -class VMObject : public Retainable<VMObject> +class VMObject : public RefCounted<VMObject> , public Weakable<VMObject> { friend class MemoryManager; |