filprofiler
filprofiler copied to clipboard
A way to differentiate missed allocations from profiling being disabled
Sometimes we get free() of address we don't recognize. It is currently hard to distinguish the following circumstances:
- Allocation wasn't added because tracking was off (explicitly, or due to startup).
- Allocation was never captured due to not overriding some allocation API (
valloc()or something). - A free() of bogus address due to a bug in application code.
One solution is to always track all allocations—but when profiling is disabled, record the allocations with size 0. As a result they won't affect outcomes of profiling, but we will at least know those allocations existed.