[llvm-branch-commits] [llvm] release/23.x: [Allocator] Cap MinAlign at alignof(max_align_t) (#235373) (PR #235386)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Oct 24 20:40:04 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: llvmbot
<details>
<summary>Changes</summary>
Backport 0b6b6ed806536c1b170101061ff3eeed91c8f061
Requested by: @<!-- -->MaskRay
---
Full diff: https://github.com/llvm/llvm-project/pull/235386.diff
1 Files Affected:
- (modified) llvm/include/llvm/Support/Allocator.h (+1-1)
``````````diff
diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
index bb0ca118e20157..b5f40ef72cd718 100644
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/include/llvm/Support/Allocator.h
@@ -64,7 +64,7 @@ LLVM_ABI void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t TotalMemory);
/// CurPtr when the requested alignment is no greater than MinAlign.
template <typename AllocatorT = MallocAllocator, size_t SlabSize = 4096,
size_t SizeThreshold = SlabSize, size_t GrowthDelay = 128,
- size_t MinAlign = 8>
+ size_t MinAlign = std::min<size_t>(8, alignof(std::max_align_t))>
class BumpPtrAllocatorImpl
: public AllocatorBase<BumpPtrAllocatorImpl<
AllocatorT, SlabSize, SizeThreshold, GrowthDelay, MinAlign>>,
``````````
</details>
https://github.com/llvm/llvm-project/pull/235386
More information about the llvm-branch-commits
mailing list