[compiler-rt] [compiler-rt][memprof] adding free_sized/free_aligned_sized intercept… (PR #154011)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 18 21:58:35 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- compiler-rt/test/memprof/TestCases/free_sized.cpp compiler-rt/lib/memprof/memprof_malloc_linux.cpp
``````````

</details>

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

``````````diff
diff --git a/compiler-rt/test/memprof/TestCases/free_sized.cpp b/compiler-rt/test/memprof/TestCases/free_sized.cpp
index 74a0ebf8d..9c1798201 100644
--- a/compiler-rt/test/memprof/TestCases/free_sized.cpp
+++ b/compiler-rt/test/memprof/TestCases/free_sized.cpp
@@ -4,18 +4,17 @@
 #include <unistd.h>
 
 extern "C" {
-	void free_sized(void *ptr, [[maybe_unused]]size_t) {
-		free(ptr);
-	}
-	void free_aligned_sized(void *ptr, [[maybe_unused]]size_t alignment, [[maybe_unused]]size_t size) {
-		free(ptr);
-	}
+void free_sized(void *ptr, [[maybe_unused]] size_t) { free(ptr); }
+void free_aligned_sized(void *ptr, [[maybe_unused]] size_t alignment,
+                        [[maybe_unused]] size_t size) {
+  free(ptr);
+}
 }
 
 int main() {
-	void *p = aligned_alloc(16, 10);
-	free_aligned_sized(p, 16, 10);
-	p = malloc(10);
-	free_sized(p, 10);
-	return 0;
+  void *p = aligned_alloc(16, 10);
+  free_aligned_sized(p, 16, 10);
+  p = malloc(10);
+  free_sized(p, 10);
+  return 0;
 }

``````````

</details>


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


More information about the llvm-commits mailing list