1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:27:45 +00:00

UserspaceEmulator: Keep Emulator& closer to the action in some places

This avoids the cost of calling Emulator::the() in some very hot paths.
This commit is contained in:
Andreas Kling 2020-11-16 14:39:05 +01:00
parent d14695f823
commit 1965fc5b98
9 changed files with 127 additions and 70 deletions

View file

@ -31,6 +31,8 @@
namespace UserspaceEmulator {
class Emulator;
class Region {
public:
virtual ~Region() { }
@ -72,14 +74,15 @@ public:
virtual u8* data() = 0;
virtual u8* shadow_data() = 0;
Emulator& emulator() { return m_emulator; }
const Emulator& emulator() const { return m_emulator; }
protected:
Region(u32 base, u32 size)
: m_base(base)
, m_size(size)
{
}
Region(u32 base, u32 size);
private:
Emulator& m_emulator;
u32 m_base { 0 };
u32 m_size { 0 };