mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
UserspaceEmulator: Hang malloc metadata on malloc block MmapRegions
Instead of tracking known malloc blocks in a separate hash table, add an optional malloc metadata pointer to MmapRegion. This makes finding the malloc metadata for a given pointer extremely fast since it can piggyback on the page table array. :^)
This commit is contained in:
@@ -58,11 +58,6 @@ MmapRegion::MmapRegion(u32 base, u32 size, int prot)
|
||||
|
||||
MmapRegion::~MmapRegion()
|
||||
{
|
||||
if (is_malloc_block()) {
|
||||
if (auto* tracer = Emulator::the().malloc_tracer())
|
||||
tracer->notify_malloc_block_was_released({}, *this);
|
||||
}
|
||||
|
||||
free(m_shadow_data);
|
||||
if (m_file_backed)
|
||||
munmap(m_data, size());
|
||||
|
||||
Reference in New Issue
Block a user