mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:07:35 +00:00
Kernel: Verify system memory info consistency
This commit is contained in:
parent
b4e45a6636
commit
ea1e5b630d
1 changed files with 7 additions and 0 deletions
|
@ -203,6 +203,7 @@ public:
|
||||||
SystemMemoryInfo get_system_memory_info()
|
SystemMemoryInfo get_system_memory_info()
|
||||||
{
|
{
|
||||||
SpinlockLocker lock(s_mm_lock);
|
SpinlockLocker lock(s_mm_lock);
|
||||||
|
verify_system_memory_info_consistency();
|
||||||
return m_system_memory_info;
|
return m_system_memory_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,6 +287,12 @@ private:
|
||||||
};
|
};
|
||||||
void release_pte(PageDirectory&, VirtualAddress, IsLastPTERelease);
|
void release_pte(PageDirectory&, VirtualAddress, IsLastPTERelease);
|
||||||
|
|
||||||
|
ALWAYS_INLINE void verify_system_memory_info_consistency() const
|
||||||
|
{
|
||||||
|
auto user_physical_pages_unused = m_system_memory_info.user_physical_pages_committed + m_system_memory_info.user_physical_pages_uncommitted;
|
||||||
|
VERIFY(m_system_memory_info.user_physical_pages == (m_system_memory_info.user_physical_pages_used + user_physical_pages_unused));
|
||||||
|
}
|
||||||
|
|
||||||
RefPtr<PageDirectory> m_kernel_page_directory;
|
RefPtr<PageDirectory> m_kernel_page_directory;
|
||||||
|
|
||||||
RefPtr<PhysicalPage> m_shared_zero_page;
|
RefPtr<PhysicalPage> m_shared_zero_page;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue