|
6 | 6 | //
|
7 | 7 | //===----------------------------------------------------------------------===//
|
8 | 8 | //
|
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). |
10 | 12 |
|
11 | 13 | #ifndef BASE_REQUIRED_TEMPLATE_TYPE
|
12 | 14 | #define BASE_REQUIRED_TEMPLATE_TYPE(...)
|
@@ -67,13 +69,12 @@ PRIMARY_REQUIRED(const uptr, CompactPtrScale)
|
67 | 69 | // Log2 of the size of a size class region, as used by the Primary.
|
68 | 70 | PRIMARY_REQUIRED(const uptr, RegionSizeLog)
|
69 | 71 |
|
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. |
77 | 78 | PRIMARY_REQUIRED(const uptr, GroupSizeLog)
|
78 | 79 |
|
79 | 80 | // Call map for user memory with at least this size. Only used with primary64.
|
|
0 commit comments