[llvm] [Support] Vendor rpmalloc in-tree and use it for the Windows 64-bit release (PR #91862)

via llvm-commits llvm-commits at lists.llvm.org
Sat May 11 12:14:13 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 de9b386f84b58ad0ffc12e221bc6d9161ca5b62d 96db69e2e640dd071ec467f2c88f9a2bfb0f4767 -- llvm/lib/Support/rpmalloc/malloc.c llvm/lib/Support/rpmalloc/rpmalloc.c llvm/lib/Support/rpmalloc/rpmalloc.h llvm/lib/Support/rpmalloc/rpnew.h
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Support/rpmalloc/malloc.c b/llvm/lib/Support/rpmalloc/malloc.c
index d4f99e5fe1..689f1503a5 100644
--- a/llvm/lib/Support/rpmalloc/malloc.c
+++ b/llvm/lib/Support/rpmalloc/malloc.c
@@ -501,8 +501,9 @@ extern inline void *RPMALLOC_CDECL pvalloc(size_t size) {
 extern __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE instance,
                                                  DWORD reason, LPVOID reserved);
 
-extern __declspec(dllexport) BOOL WINAPI
-DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) {
+extern __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE instance,
+                                                 DWORD reason,
+                                                 LPVOID reserved) {
   (void)sizeof(reserved);
   (void)sizeof(instance);
   if (reason == DLL_PROCESS_ATTACH)
diff --git a/llvm/lib/Support/rpmalloc/rpmalloc.c b/llvm/lib/Support/rpmalloc/rpmalloc.c
index 0f9257563a..6115d45133 100644
--- a/llvm/lib/Support/rpmalloc/rpmalloc.c
+++ b/llvm/lib/Support/rpmalloc/rpmalloc.c
@@ -444,17 +444,17 @@ _Static_assert((SPAN_HEADER_SIZE & (SPAN_HEADER_SIZE - 1)) == 0,
 #if ENABLE_VALIDATE_ARGS
 //! Maximum allocation size to avoid integer overflow
 #undef MAX_ALLOC_SIZE
-#define MAX_ALLOC_SIZE (((size_t)-1) - _memory_span_size)
+#define MAX_ALLOC_SIZE (((size_t) - 1) - _memory_span_size)
 #endif
 
 #define pointer_offset(ptr, ofs) (void *)((char *)(ptr) + (ptrdiff_t)(ofs))
 #define pointer_diff(first, second)                                            \
   (ptrdiff_t)((const char *)(first) - (const char *)(second))
 
-#define INVALID_POINTER ((void *)((uintptr_t)-1))
+#define INVALID_POINTER ((void *)((uintptr_t) - 1))
 
 #define SIZE_CLASS_LARGE SIZE_CLASS_COUNT
-#define SIZE_CLASS_HUGE ((uint32_t)-1)
+#define SIZE_CLASS_HUGE ((uint32_t) - 1)
 
 ////////////
 ///

``````````

</details>


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


More information about the llvm-commits mailing list