summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2021-09-27 17:59:15 -0700
committerLang Hames <lhames@gmail.com>2021-09-27 18:02:06 -0700
commit22f8276fe429765cefadc236f4bc91cb26211935 (patch)
treee69106bc9266bc691bbff75c81eac8e7d0f86600
parent593b074a096c542c6753916caa754f321a111f21 (diff)
downloadllvm-22f8276fe429765cefadc236f4bc91cb26211935.tar.gz
[llvm-jitlink] Add more information about allocation failures.
Slab allocator failures will now report requested size and remaining capacity.
-rw-r--r--llvm/tools/llvm-jitlink/llvm-jitlink.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index 37870b3ec42b..5a4898c3d598 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -437,7 +437,12 @@ public:
uint64_t SlabRemainingSize = SlabRemaining.allocatedSize();
if (SegmentSize > SlabRemainingSize)
- return make_error<StringError>("Slab allocator out of memory",
+ return make_error<StringError>("Slab allocator out of memory: "
+ "request for " +
+ formatv("{0:x}", SegmentSize) +
+ " bytes exceeds remaining capacity of " +
+ formatv("{0:x}", SlabRemainingSize) +
+ " bytes",
inconvertibleErrorCode());
sys::MemoryBlock SegMem(SlabBase, SegmentSize);