File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
llvm/include/llvm/Support Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -159,9 +159,9 @@ class BumpPtrAllocatorImpl
159
159
#endif
160
160
161
161
// Check if we have enough space.
162
- if (Adjustment + SizeToAllocate <= size_t (End - CurPtr)
163
- // We can't return nullptr even for a zero-sized allocation!
164
- && CurPtr != nullptr ) {
162
+ if (LLVM_LIKELY ( Adjustment + SizeToAllocate <= size_t (End - CurPtr)
163
+ // We can't return nullptr even for a zero-sized allocation!
164
+ && CurPtr != nullptr ) ) {
165
165
char *AlignedPtr = CurPtr + Adjustment;
166
166
CurPtr = AlignedPtr + SizeToAllocate;
167
167
// Update the allocation point of this memory block in MemorySanitizer.
@@ -173,6 +173,11 @@ class BumpPtrAllocatorImpl
173
173
return AlignedPtr;
174
174
}
175
175
176
+ return AllocateSlow (Size, SizeToAllocate, Alignment);
177
+ }
178
+
179
+ LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_NOINLINE void *
180
+ AllocateSlow (size_t Size, size_t SizeToAllocate, Align Alignment) {
176
181
// If Size is really big, allocate a separate slab for it.
177
182
size_t PaddedSize = SizeToAllocate + Alignment.value () - 1 ;
178
183
if (PaddedSize > SizeThreshold) {
You can’t perform that action at this time.
0 commit comments