diff --git a/compiler-rt/lib/scudo/standalone/local_cache.h b/compiler-rt/lib/scudo/standalone/local_cache.h --- a/compiler-rt/lib/scudo/standalone/local_cache.h +++ b/compiler-rt/lib/scudo/standalone/local_cache.h @@ -80,8 +80,10 @@ // the memory accesses in close quarters. const uptr ClassSize = C->ClassSize; CompactPtrT CompactP = C->Chunks[--C->Count]; - Stats.add(StatAllocated, ClassSize); - Stats.sub(StatFree, ClassSize); + if (ClassId != BatchClassId) { + Stats.add(StatAllocated, ClassSize); + Stats.sub(StatFree, ClassSize); + } return Allocator->decompactPtr(ClassId, CompactP); } @@ -97,8 +99,10 @@ const uptr ClassSize = C->ClassSize; C->Chunks[C->Count++] = Allocator->compactPtr(ClassId, reinterpret_cast(P)); - Stats.sub(StatAllocated, ClassSize); - Stats.add(StatFree, ClassSize); + if (ClassId != BatchClassId) { + Stats.sub(StatAllocated, ClassSize); + Stats.add(StatFree, ClassSize); + } } bool isEmpty() const {