[llvm] [Support] Use malloc instead of non-throwing new (PR #92157)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 11:24:33 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 39d123f58a0e3c5f1a928940244b8dfd827fd4e5 165a2f5ff93c411893725ec733f96f981e7e477c -- llvm/lib/Support/MemoryBuffer.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
index e30c3acdb8..f7b28ff298 100644
--- a/llvm/lib/Support/MemoryBuffer.cpp
+++ b/llvm/lib/Support/MemoryBuffer.cpp
@@ -315,7 +315,7 @@ WritableMemoryBuffer::getNewUninitMemBuffer(size_t Size,
size_t RealLen = StringLen + Size + 1 + BufAlign.value();
if (RealLen <= Size) // Check for rollover.
return nullptr;
- char *Mem = static_cast<char*>(std::malloc(RealLen));
+ char *Mem = static_cast<char *>(std::malloc(RealLen));
if (!Mem)
return nullptr;
``````````
</details>
https://github.com/llvm/llvm-project/pull/92157
More information about the llvm-commits
mailing list