mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
AK: Rename Retainable => RefCounted.
(And various related renames that go along with it.)
This commit is contained in:
parent
ef1bfcb9d8
commit
77b9fa89dd
45 changed files with 118 additions and 118 deletions
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
class Inode;
|
||||
class VMObject;
|
||||
|
||||
class Region : public Retainable<Region> {
|
||||
class Region : public RefCounted<Region> {
|
||||
friend class MemoryManager;
|
||||
|
||||
public:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
class Inode;
|
||||
class PhysicalPage;
|
||||
|
||||
class VMObject : public Retainable<VMObject>
|
||||
class VMObject : public RefCounted<VMObject>
|
||||
, public Weakable<VMObject> {
|
||||
friend class MemoryManager;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue