Skip to content

Commit 33b9980

Browse files
committed
Update for comments.
1 parent b8b51fd commit 33b9980

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ class Allocator {
184184
const s32 ReleaseToOsIntervalMs = getFlags()->release_to_os_interval_ms;
185185
Primary.init(ReleaseToOsIntervalMs);
186186
Secondary.init(&Stats, ReleaseToOsIntervalMs);
187-
if (!AllocatorConfig::getQuarantineDisabled())
187+
if (!AllocatorConfig::getQuarantineDisabled()) {
188188
Quarantine.init(
189189
static_cast<uptr>(getFlags()->quarantine_size_kb << 10),
190190
static_cast<uptr>(getFlags()->thread_local_quarantine_size_kb << 10));
191+
}
191192
}
192193

193194
void enableRingBuffer() NO_THREAD_SAFETY_ANALYSIS {
@@ -277,18 +278,20 @@ class Allocator {
277278
// the last two items).
278279
void commitBack(TSD<ThisT> *TSD) {
279280
TSD->assertLocked(/*BypassCheck=*/true);
280-
if (!AllocatorConfig::getQuarantineDisabled())
281+
if (!AllocatorConfig::getQuarantineDisabled()) {
281282
Quarantine.drain(&TSD->getQuarantineCache(),
282283
QuarantineCallback(*this, TSD->getSizeClassAllocator()));
284+
}
283285
TSD->getSizeClassAllocator().destroy(&Stats);
284286
}
285287

286288
void drainCache(TSD<ThisT> *TSD) {
287289
TSD->assertLocked(/*BypassCheck=*/true);
288-
if (!AllocatorConfig::getQuarantineDisabled())
290+
if (!AllocatorConfig::getQuarantineDisabled()) {
289291
Quarantine.drainAndRecycle(
290292
&TSD->getQuarantineCache(),
291293
QuarantineCallback(*this, TSD->getSizeClassAllocator()));
294+
}
292295
TSD->getSizeClassAllocator().drain();
293296
}
294297
void drainCaches() { TSDRegistry.drainCaches(this); }

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ TEST(ScudoCombinedTest, QuarantineEnabled) {
11331133
}
11341134
EXPECT_GE(Stats.size(), ActualSize);
11351135

1136-
// No quarantine stats should exist.
1136+
// Quarantine stats should be present.
11371137
EXPECT_NE(Stats.find("Stats: Quarantine"), std::string::npos);
11381138
}
11391139

@@ -1158,6 +1158,6 @@ TEST(ScudoCombinedTest, QuarantineDisabled) {
11581158
}
11591159
EXPECT_GE(Stats.size(), ActualSize);
11601160

1161-
// No quarantine stats should exist.
1161+
// No quarantine stats should not be present.
11621162
EXPECT_EQ(Stats.find("Stats: Quarantine"), std::string::npos);
11631163
}

0 commit comments

Comments
 (0)