Skip to content

Commit afe7a67

Browse files
committed
Comment revised and fix lint
1 parent fff15fd commit afe7a67

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file defines all the flags and types supported in Scudo.
9+
// This file defines all the flags and types supported in Scudo. For optional
10+
// flags and types, only explicitly define them when interested (i.e., unused
11+
// optional flags or types can be skipped).
1012

1113
#ifndef BASE_REQUIRED_TEMPLATE_TYPE
1214
#define BASE_REQUIRED_TEMPLATE_TYPE(...)
@@ -67,13 +69,12 @@ PRIMARY_REQUIRED(const uptr, CompactPtrScale)
6769
// Log2 of the size of a size class region, as used by the Primary.
6870
PRIMARY_REQUIRED(const uptr, RegionSizeLog)
6971

70-
// Log2 of the size of block group, as used by the Primary. Each group
71-
// contains a range of memory addresses, blocks in the range will belong
72-
// to the same group. In general, single region may have 1 or 2MB group
73-
// size. Multiple regions will have the group size equal to the region
74-
// size because the region size is usually smaller than 1 MB.
75-
// Smaller value gives fine-grained control of memory usage but the
76-
// trade-off is that it may take longer time of deallocation.
72+
// Conceptually, a region will be divided into groups based on the address range
73+
// Each allocation consumes blocks in the same group until the exhaustion then
74+
// it pops out blocks in a new group. Therefore, `GroupSizeLog` is always
75+
// smaller or equal to `RegionSizeLog`. Note that `GroupSizeLog` needs to be
76+
// equal to `RegionSizeLog` for SizeClassAllocator32 because of certain
77+
// constraints.
7778
PRIMARY_REQUIRED(const uptr, GroupSizeLog)
7879

7980
// Call map for user memory with at least this size. Only used with primary64.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ template <typename AllocatorConfig> struct SecondaryConfig {
125125
}
126126
#include "allocator_config.def"
127127
}; // CacheConfig
128-
}; // SecondaryConfig
128+
}; // SecondaryConfig
129129

130130
#undef OPTIONAL_TEMPLATE
131131
#undef OPTIONAL_TEMPLATE_TYPE

0 commit comments

Comments
 (0)