mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:48:13 +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:
parent
d14695f823
commit
1965fc5b98
9 changed files with 127 additions and 70 deletions
|
@ -35,7 +35,7 @@
|
|||
|
||||
namespace UserspaceEmulator {
|
||||
|
||||
class MmapRegion;
|
||||
class Emulator;
|
||||
class SoftCPU;
|
||||
|
||||
struct Mallocation {
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
|
||||
class MallocTracer {
|
||||
public:
|
||||
MallocTracer();
|
||||
explicit MallocTracer(Emulator&);
|
||||
|
||||
void target_did_malloc(Badge<SoftCPU>, FlatPtr address, size_t);
|
||||
void target_did_free(Badge<SoftCPU>, FlatPtr address);
|
||||
|
@ -87,6 +87,8 @@ private:
|
|||
Mallocation* find_mallocation_after(FlatPtr);
|
||||
bool is_reachable(const Mallocation&) const;
|
||||
|
||||
Emulator& m_emulator;
|
||||
|
||||
bool m_auditing_enabled { true };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue