[clang] Improve stack usage to increase recursive initialization depth (PR #88546)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 15 14:32:20 PDT 2024
================
@@ -1163,7 +1137,7 @@ class Sema;
ConversionSequenceList
allocateConversionSequences(unsigned NumConversions) {
ImplicitConversionSequence *Conversions =
- slabAllocate<ImplicitConversionSequence>(NumConversions);
+ Ctx.Allocate<ImplicitConversionSequence>(NumConversions);
// Construct the new objects.
for (unsigned I = 0; I != NumConversions; ++I)
----------------
cor3ntin wrote:
Maybe something like that would be cleaner
```cpp
ConversionSequenceList allocateConversionSequences(unsigned NumConversions) {
ImplicitConversionSequence *Conversions = Ctx.Allocate<ImplicitConversionSequence>(NumConversions);
std::uninitialized_default_construct(Conversions, Conversions + NumConversions);
return ConversionSequenceList(Conversions, NumConversions);
}
```
https://github.com/llvm/llvm-project/pull/88546
More information about the cfe-commits
mailing list