[compiler-rt] 5df9995 - [NFC][sanitizer] Rename some MemoryMapper members
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 13 15:33:36 PDT 2021
Author: Vitaly Buka
Date: 2021-07-13T15:33:22-07:00
New Revision: 5df99954392e3a4448e4ff43d4cf644bc06bfa92
URL: https://github.com/llvm/llvm-project/commit/5df99954392e3a4448e4ff43d4cf644bc06bfa92
DIFF: https://github.com/llvm/llvm-project/commit/5df99954392e3a4448e4ff43d4cf644bc06bfa92.diff
LOG: [NFC][sanitizer] Rename some MemoryMapper members
Part of D105778
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
index d46b0d3d29ede..03f26f0ba8372 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
@@ -47,13 +47,13 @@ class MemoryMapper {
public:
typedef typename Allocator::CompactPtrT CompactPtrT;
- MemoryMapper(const Allocator &base_allocator, uptr class_id)
- : allocator(base_allocator),
- region_base(base_allocator.GetRegionBeginBySizeClass(class_id)) {}
+ MemoryMapper(const Allocator &allocator, uptr class_id)
+ : allocator_(allocator),
+ region_base_(allocator.GetRegionBeginBySizeClass(class_id)) {}
- uptr GetReleasedRangesCount() const { return released_ranges_count; }
+ uptr GetReleasedRangesCount() const { return released_ranges_count_; }
- uptr GetReleasedBytes() const { return released_bytes; }
+ uptr GetReleasedBytes() const { return released_bytes_; }
void *MapPackedCounterArrayBuffer(uptr buffer_size) {
// TODO(alekseyshl): The idea to explore is to check if we have enough
@@ -69,18 +69,18 @@ class MemoryMapper {
// Releases [from, to) range of pages back to OS.
void ReleasePageRangeToOS(CompactPtrT from, CompactPtrT to) {
- const uptr from_page = allocator.CompactPtrToPointer(region_base, from);
- const uptr to_page = allocator.CompactPtrToPointer(region_base, to);
+ const uptr from_page = allocator_.CompactPtrToPointer(region_base_, from);
+ const uptr to_page = allocator_.CompactPtrToPointer(region_base_, to);
ReleaseMemoryPagesToOS(from_page, to_page);
- released_ranges_count++;
- released_bytes += to_page - from_page;
+ released_ranges_count_++;
+ released_bytes_ += to_page - from_page;
}
private:
- const Allocator &allocator;
- const uptr region_base = 0;
- uptr released_ranges_count = 0;
- uptr released_bytes = 0;
+ const Allocator &allocator_;
+ const uptr region_base_ = 0;
+ uptr released_ranges_count_ = 0;
+ uptr released_bytes_ = 0;
};
template <class Params>
More information about the llvm-commits
mailing list