We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 332d9f3 commit 465ff74Copy full SHA for 465ff74
src/jitlayers.h
@@ -312,7 +312,9 @@ class MaxAlignedAllocImpl
312
// the returned pointer, this is >= alignof(std::max_align_t), which is too
313
// small often to actually use.
314
const size_t MaxAlignment = JL_CACHE_BYTE_ALIGNMENT;
315
- return Align(std::min((size_t)llvm::PowerOf2Ceil(Size), MaxAlignment));
+ if (Size <= offset)
316
+ return Align(1);
317
+ return Align(std::min((size_t)llvm::PowerOf2Ceil(Size - offset), MaxAlignment));
318
}
319
320
LLVM_ATTRIBUTE_RETURNS_NONNULL void *Allocate(size_t Size, Align Alignment) {
0 commit comments