Skip to content

Commit be2598a

Browse files
Camsynmiguelcsx
authored andcommitted
[NFC][Sanitizer] Fix incorrect desc of [beg, end] to [beg, end)
Correct the interval desc of ReleaseMemoryPagesToOS from [beg, end] to [beg, end), as it actually does. The previous incorrect description of [beg, end] might cause an incorrect invoke as follows: `ReleaseMemoryPagesToOS(0, kPageSize - 1);`
1 parent 478b470 commit be2598a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding,
166166

167167
// Used to check if we can map shadow memory to a fixed location.
168168
bool MemoryRangeIsAvailable(uptr range_start, uptr range_end);
169-
// Releases memory pages entirely within the [beg, end] address range. Noop if
169+
// Releases memory pages entirely within the [beg, end) address range. Noop if
170170
// the provided range does not contain at least one entire page.
171171
void ReleaseMemoryPagesToOS(uptr beg, uptr end);
172172
void IncreaseTotalMmap(uptr size);

compiler-rt/lib/sanitizer_common/sanitizer_linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ bool LibraryNameIs(const char *full_name, const char *base_name);
130130
// Call cb for each region mapped by map.
131131
void ForEachMappedRegion(link_map *map, void (*cb)(const void *, uptr));
132132

133-
// Releases memory pages entirely within the [beg, end] address range.
133+
// Releases memory pages entirely within the [beg, end) address range.
134134
// The pages no longer count toward RSS; reads are guaranteed to return 0.
135135
// Requires (but does not verify!) that pages are MAP_PRIVATE.
136136
inline void ReleaseMemoryPagesToOSAndZeroFill(uptr beg, uptr end) {

0 commit comments

Comments
 (0)