summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Phillips <31459023+hctim@users.noreply.github.com>2021-05-07 00:06:52 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-05-07 00:06:52 +0000
commitdfe79d093fb2d46335366b8a817b0bc8dccb28da (patch)
tree3af8baedb1d1b3762b3f502d2541e8cd7c455e3a
parent64cdf20e95dcf1f83d26ed94f0267845ee7f639a (diff)
parent2f6baed6f56f26d8bf39cac272f533159cf116a2 (diff)
downloadscudo-dfe79d093fb2d46335366b8a817b0bc8dccb28da.tar.gz
[scudo] Don't track free/use stats for transfer batches. am: bebf30bf68 am: 47ab6b8d5d am: 5b88e62f00 am: 2f6baed6f5
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/1698913 Change-Id: If6ac702428d68edcf953a81028cf15b31d6b0f5e
-rw-r--r--standalone/local_cache.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/standalone/local_cache.h b/standalone/local_cache.h
index 43cbc68ead3..50039379fa0 100644
--- a/standalone/local_cache.h
+++ b/standalone/local_cache.h
@@ -135,6 +135,7 @@ private:
struct PerClass {
u32 Count;
u32 MaxCount;
+ // Note: ClassSize is zero for the transfer batch.
uptr ClassSize;
CompactPtrT Chunks[2 * TransferBatch::MaxNumCached];
};
@@ -154,7 +155,13 @@ private:
PerClass *P = &PerClassArray[I];
const uptr Size = SizeClassAllocator::getSizeByClassId(I);
P->MaxCount = 2 * TransferBatch::getMaxCached(Size);
- P->ClassSize = Size;
+ if (I != BatchClassId) {
+ P->ClassSize = Size;
+ } else {
+ // ClassSize in this struct is only used for malloc/free stats, which
+ // should only track user allocations, not internal movements.
+ P->ClassSize = 0;
+ }
}
}