1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 22:48:11 +00:00

Show the amount of memory in GraphicsBitmaps in /bin/top.

This seems like an extremely relevant metric to track.
This commit is contained in:
Andreas Kling 2019-02-05 09:27:27 +01:00
parent b1e054ffe8
commit 41567c5bb9
6 changed files with 37 additions and 13 deletions

View file

@ -23,10 +23,12 @@ GraphicsBitmap::GraphicsBitmap(Process& process, const Size& size)
auto vmo = VMObject::create_anonymous(size_in_bytes);
m_client_region = process.allocate_region_with_vmo(LinearAddress(), size_in_bytes, vmo.copy_ref(), 0, "GraphicsBitmap (client)", true, true);
m_client_region->set_shared(true);
m_client_region->set_is_bitmap(true);
m_client_region->commit();
auto& server = WSMessageLoop::the().server_process();
m_server_region = server.allocate_region_with_vmo(LinearAddress(), size_in_bytes, move(vmo), 0, "GraphicsBitmap (server)", true, false);
m_server_region->set_shared(true);
m_server_region->set_is_bitmap(true);
m_data = (RGBA32*)m_server_region->laddr().as_ptr();
}