Skip to content

Commit b3240e1

Browse files
committed
Updates for comments.
1 parent c71497c commit b3240e1

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

compiler-rt/lib/scudo/standalone/allocator_config.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ PRIMARY_REQUIRED(const s32, MaxReleaseToOsIntervalMs)
8383
//
8484

8585
// Enables/disables primary block caching. Batch class still caches.
86-
PRIMARY_OPTIONAL(const bool, EnableCache, true)
86+
PRIMARY_OPTIONAL(const bool, EnableBlockCache, true)
8787

8888
// The scale of a compact pointer. E.g., Ptr = Base + (CompactPtr << Scale).
8989
PRIMARY_OPTIONAL(const uptr, CompactPtrScale, SCUDO_MIN_ALIGNMENT_LOG)

compiler-rt/lib/scudo/standalone/primary32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ template <typename Config> class SizeClassAllocator32 {
5353
"");
5454
typedef SizeClassAllocator32<Config> ThisT;
5555
using SizeClassAllocatorT =
56-
typename Conditional<Config::getEnableCache(),
56+
typename Conditional<Config::getEnableBlockCache(),
5757
SizeClassAllocatorLocalCache<ThisT>,
5858
SizeClassAllocatorNoCache<ThisT>>::type;
5959
typedef TransferBatch<ThisT> TransferBatchT;

compiler-rt/lib/scudo/standalone/primary64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ template <typename Config> class SizeClassAllocator64 {
6060
typedef TransferBatch<ThisT> TransferBatchT;
6161
typedef BatchGroup<ThisT> BatchGroupT;
6262
using SizeClassAllocatorT =
63-
typename Conditional<Config::getEnableCache(),
63+
typename Conditional<Config::getEnableBlockCache(),
6464
SizeClassAllocatorLocalCache<ThisT>,
6565
SizeClassAllocatorNoCache<ThisT>>::type;
6666

compiler-rt/lib/scudo/standalone/size_class_allocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ template <class SizeClassAllocator> struct SizeClassAllocatorNoCache {
225225
// in SizeClassAllocatorLocalCache so that use the same hint when doing
226226
// a page release.
227227
++C->Count;
228-
const bool SuggestDraining = C->Count == C->MaxCount;
228+
const bool SuggestDraining = C->Count >= C->MaxCount;
229229
if (SuggestDraining)
230230
C->Count = 0;
231231
return SuggestDraining;
@@ -292,7 +292,7 @@ template <class SizeClassAllocator> struct SizeClassAllocatorNoCache {
292292
bool deallocateBatchClassBlock(void *P) {
293293
PerClass *C = &PerClassArray[BatchClassId];
294294
// Drain all the blocks.
295-
if (C->Count == C->MaxCount) {
295+
if (C->Count >= C->MaxCount) {
296296
Allocator->pushBlocks(this, BatchClassId, BatchClassStorage, C->Count);
297297
C->Count = 0;
298298
}

compiler-rt/lib/scudo/standalone/tests/combined_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ struct TestNoCacheConfig {
233233
static const scudo::uptr GroupSizeLog = 18U;
234234
typedef scudo::uptr CompactPtrT;
235235
#endif
236-
static const bool EnableCache = false;
236+
static const bool EnableBlockCache = false;
237237
static const scudo::s32 MinReleaseToOsIntervalMs = 1000;
238238
static const scudo::s32 MaxReleaseToOsIntervalMs = 1000;
239239
};

0 commit comments

Comments
 (0)