In the secondary allocation routine, the StatsAllocated stat is
increased by BlockSize. However, in the deallocate routine, the
stat subtract uses CommitSize. CommitSize can be bigger than BlockSize
so this can lead to a negative calculated stat. Since the stats
are not guaranteed to be completely accurate, just add CommitSize
during allocation.
Details
Details
- Reviewers
Chia-hungDuan - Commits
- rG526027df2d62: [scudo] Change secondary StatsAllocated update
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Nice catch! I think we may also want to update this to H->CommitSize.