|
@@ -52,19 +52,15 @@ public:
|
|
ALWAYS_INLINE void add_region(Region& region)
|
|
ALWAYS_INLINE void add_region(Region& region)
|
|
{
|
|
{
|
|
ScopedSpinLock locker(m_lock);
|
|
ScopedSpinLock locker(m_lock);
|
|
- m_regions_count++;
|
|
|
|
m_regions.append(region);
|
|
m_regions.append(region);
|
|
}
|
|
}
|
|
|
|
|
|
ALWAYS_INLINE void remove_region(Region& region)
|
|
ALWAYS_INLINE void remove_region(Region& region)
|
|
{
|
|
{
|
|
ScopedSpinLock locker(m_lock);
|
|
ScopedSpinLock locker(m_lock);
|
|
- m_regions_count--;
|
|
|
|
m_regions.remove(region);
|
|
m_regions.remove(region);
|
|
}
|
|
}
|
|
|
|
|
|
- ALWAYS_INLINE bool is_shared_by_multiple_regions() const { return m_regions_count > 1; }
|
|
|
|
-
|
|
|
|
void register_on_deleted_handler(VMObjectDeletedHandler& handler)
|
|
void register_on_deleted_handler(VMObjectDeletedHandler& handler)
|
|
{
|
|
{
|
|
ScopedSpinLock locker(m_on_deleted_lock);
|
|
ScopedSpinLock locker(m_on_deleted_lock);
|
|
@@ -93,7 +89,6 @@ private:
|
|
VMObject& operator=(VMObject&&) = delete;
|
|
VMObject& operator=(VMObject&&) = delete;
|
|
VMObject(VMObject&&) = delete;
|
|
VMObject(VMObject&&) = delete;
|
|
|
|
|
|
- Atomic<u32, AK::MemoryOrder::memory_order_relaxed> m_regions_count { 0 };
|
|
|
|
HashTable<VMObjectDeletedHandler*> m_on_deleted;
|
|
HashTable<VMObjectDeletedHandler*> m_on_deleted;
|
|
SpinLock<u8> m_on_deleted_lock;
|
|
SpinLock<u8> m_on_deleted_lock;
|
|
|
|
|