[compiler-rt] eba322e - [Sanitizer] Make GetBlockBeginFastLocked parameters const.

Kirill Stoimenov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 16:01:46 PST 2023


Author: Kirill Stoimenov
Date: 2023-01-24T00:01:35Z
New Revision: eba322e9d7247a64751dd2450f7c37cd960f0155

URL: https://github.com/llvm/llvm-project/commit/eba322e9d7247a64751dd2450f7c37cd960f0155
DIFF: https://github.com/llvm/llvm-project/commit/eba322e9d7247a64751dd2450f7c37cd960f0155.diff

LOG: [Sanitizer] Make GetBlockBeginFastLocked parameters const.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D142402

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
    compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
index b92cfa5bf4c4b..b76d36dcf5a4e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
@@ -134,7 +134,7 @@ class CombinedAllocator {
 
   // This function does the same as GetBlockBegin, but is much faster.
   // Must be called with the allocator locked.
-  void *GetBlockBeginFastLocked(void *p) {
+  void *GetBlockBeginFastLocked(const void *p) {
     if (primary_.PointerIsMine(p))
       return primary_.GetBlockBegin(p);
     return secondary_.GetBlockBeginFastLocked(p);

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h
index 48afb2a298341..1576455556044 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h
@@ -215,7 +215,7 @@ class LargeMmapAllocator {
 
   // This function does the same as GetBlockBegin, but is much faster.
   // Must be called with the allocator locked.
-  void *GetBlockBeginFastLocked(void *ptr) {
+  void *GetBlockBeginFastLocked(const void *ptr) {
     mutex_.CheckLocked();
     uptr p = reinterpret_cast<uptr>(ptr);
     uptr n = n_chunks_;


        


More information about the llvm-commits mailing list