[compiler-rt] [scudo][NFC] Add a default unmap() to unmap all pages (PR #102234)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 14:41:11 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 10d7805c4f8f2226bee23c4cc021cebc2c56727e f96933a4fdec05bfaabf6cb9e85b6e96fb7b2160 --extensions cpp,h -- compiler-rt/lib/scudo/standalone/combined.h compiler-rt/lib/scudo/standalone/mem_map_base.h compiler-rt/lib/scudo/standalone/primary64.h compiler-rt/lib/scudo/standalone/release.h compiler-rt/lib/scudo/standalone/secondary.h compiler-rt/lib/scudo/standalone/tests/common_test.cpp compiler-rt/lib/scudo/standalone/tests/map_test.cpp compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp compiler-rt/lib/scudo/standalone/tests/strings_test.cpp compiler-rt/lib/scudo/standalone/tests/vector_test.cpp compiler-rt/lib/scudo/standalone/vector.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/mem_map_base.h b/compiler-rt/lib/scudo/standalone/mem_map_base.h
index cba02a16b0..dbf4ec3af9 100644
--- a/compiler-rt/lib/scudo/standalone/mem_map_base.h
+++ b/compiler-rt/lib/scudo/standalone/mem_map_base.h
@@ -36,9 +36,7 @@ public:
     invokeImpl(&Derived::unmapImpl, Addr, Size);
   }
   // A default implementation to unmap all pages.
-  void unmap() {
-    unmap(getBase(), getCapacity());
-  }
+  void unmap() { unmap(getBase(), getCapacity()); }
 
   // This is used to remap a mapped range (either from map() or dispatched from
   // ReservedMemory). For example, we have reserved several pages and then we
diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index 88eb5bd1ee..a9a7c2c8ea 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -65,9 +65,7 @@ template <typename Config> static Header *getHeader(const void *Ptr) {
 
 } // namespace LargeBlock
 
-static inline void unmap(MemMapT &MemMap) {
-  MemMap.unmap();
-}
+static inline void unmap(MemMapT &MemMap) { MemMap.unmap(); }
 
 namespace {
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/102234


More information about the llvm-commits mailing list