Skip to content

Commit 22f8276

Browse files
committed
[llvm-jitlink] Add more information about allocation failures.
Slab allocator failures will now report requested size and remaining capacity.
1 parent 593b074 commit 22f8276

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,12 @@ class JITLinkSlabAllocator final : public JITLinkMemoryManager {
437437
uint64_t SlabRemainingSize = SlabRemaining.allocatedSize();
438438

439439
if (SegmentSize > SlabRemainingSize)
440-
return make_error<StringError>("Slab allocator out of memory",
440+
return make_error<StringError>("Slab allocator out of memory: "
441+
"request for " +
442+
formatv("{0:x}", SegmentSize) +
443+
" bytes exceeds remaining capacity of " +
444+
formatv("{0:x}", SlabRemainingSize) +
445+
" bytes",
441446
inconvertibleErrorCode());
442447

443448
sys::MemoryBlock SegMem(SlabBase, SegmentSize);

0 commit comments

Comments
 (0)