mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
Replace zones with individually tracked physical pages.
It's just a simple struct { ref_count, paddr }. This will allow me to implement lazy zeroing and COW pages.
This commit is contained in:
parent
b5c5286ee1
commit
72cdc62155
10 changed files with 161 additions and 127 deletions
|
@ -32,6 +32,7 @@ public:
|
|||
RetainPtr(RetainPtr& other) : m_ptr(other.copyRef().leakRef()) { }
|
||||
RetainPtr(RetainPtr&& other) : m_ptr(other.leakRef()) { }
|
||||
template<typename U> RetainPtr(RetainPtr<U>&& other) : m_ptr(static_cast<T*>(other.leakRef())) { }
|
||||
RetainPtr(const RetainPtr& other) : m_ptr(const_cast<RetainPtr&>(other).copyRef().leakRef()) { }
|
||||
~RetainPtr()
|
||||
{
|
||||
clear();
|
||||
|
@ -121,6 +122,8 @@ public:
|
|||
|
||||
operator bool() { return !!m_ptr; }
|
||||
|
||||
bool is_null() const { return !m_ptr; }
|
||||
|
||||
private:
|
||||
T* m_ptr = nullptr;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue