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 c8ca350 commit 72cd63cCopy full SHA for 72cd63c
src/jitlayers.h
@@ -306,7 +306,9 @@ class MaxAlignedAllocImpl
306
// the returned pointer, this is >= alignof(std::max_align_t), which is too
307
// small often to actually use.
308
const size_t MaxAlignment = JL_CACHE_BYTE_ALIGNMENT;
309
- return Align(std::min((size_t)llvm::PowerOf2Ceil(Size), MaxAlignment));
+ if (Size <= offset)
310
+ return Align(1);
311
+ return Align(std::min((size_t)llvm::PowerOf2Ceil(Size - offset), MaxAlignment));
312
}
313
314
LLVM_ATTRIBUTE_RETURNS_NONNULL void *Allocate(size_t Size, Align Alignment) {
0 commit comments