mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
UserspaceEmulator: Forget ChunkedBlocks after they are munmap()'ed
This is not ideal since we lose free() backtraces, but it will require some thinking to get this right.
This commit is contained in:
parent
2066f48b87
commit
8fd97bee7f
3 changed files with 16 additions and 0 deletions
|
@ -58,6 +58,11 @@ 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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue