mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
UserspaceEmulator+LibC: Have UE notice realloc() and update accounting
When a mallocation is shrunk/grown without moving, UE needs to update its precise metadata about the mallocation, since it tracks *exactly* how many bytes were allocated, not just the malloc chunk size.
This commit is contained in:
@@ -111,6 +111,9 @@ void SoftCPU::did_receive_secret_data()
|
||||
} else if (m_secret_data[0] == 2) {
|
||||
if (auto* tracer = m_emulator.malloc_tracer())
|
||||
tracer->target_did_free({}, m_secret_data[1]);
|
||||
} else if (m_secret_data[0] == 3) {
|
||||
if (auto* tracer = m_emulator.malloc_tracer())
|
||||
tracer->target_did_realloc({}, m_secret_data[2], m_secret_data[1]);
|
||||
} else {
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user