Fix negative heap-size atrace reporting
Updating last_reported_heap_size_ in RecordFree() was a bad idea. We
should have relied on num_bytes_allocated_ to give us the right size to
report.
Otherwise, we could easily have situation where after the
tracing was enabled, last-reported-size would be initialized to 0 and
reducing freed-bytes would almost certainly underflow, unless there was
a TLAB allocation in between.
Bug: 480968015
Bug: 460518265
Flag: EXEMPT BUGFIX
Test: manual perfetto trace lookup
Change-Id: I62cbba75efa4064a4cf0b2b71522420c51e47b68
1 file changed