Skip to content

Commit 9ccb602

Browse files
committed
[NFC][sanitizer] Add a few consts
1 parent 982bfec commit 9ccb602

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class SizeClassAllocator32 {
198198
return GetSizeClass(p) != 0;
199199
}
200200

201-
uptr GetSizeClass(const void *p) {
201+
uptr GetSizeClass(const void *p) const {
202202
return possible_regions[ComputeRegionId(reinterpret_cast<uptr>(p))];
203203
}
204204

@@ -251,7 +251,7 @@ class SizeClassAllocator32 {
251251

252252
// Iterate over all existing chunks.
253253
// The allocator must be locked when calling this function.
254-
void ForEachChunk(ForEachChunkCallback callback, void *arg) {
254+
void ForEachChunk(ForEachChunkCallback callback, void *arg) const {
255255
for (uptr region = 0; region < kNumPossibleRegions; region++)
256256
if (possible_regions[region]) {
257257
uptr chunk_size = ClassIdToSize(possible_regions[region]);

compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FlatMap {
4141
CHECK_EQ(0U, map_[idx]);
4242
map_[idx] = val;
4343
}
44-
u8 operator[](uptr idx) {
44+
u8 operator[](uptr idx) const {
4545
CHECK_LT(idx, kSize);
4646
// FIXME: CHECK may be too expensive here.
4747
return map_[idx];

0 commit comments

Comments
 (0)