From 95add0cc0e798012e9e4ccfdb062445624a42b1a Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 25 Mar 2026 21:12:23 -0400 Subject: [PATCH] xo-alloc2: abox: nice message on alloc fail --- include/xo/alloc2/abox.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/xo/alloc2/abox.hpp b/include/xo/alloc2/abox.hpp index d34271a..1e032b0 100644 --- a/include/xo/alloc2/abox.hpp +++ b/include/xo/alloc2/abox.hpp @@ -7,6 +7,7 @@ #include "Allocator.hpp" #include +#include #include namespace xo { @@ -76,7 +77,13 @@ namespace xo { return abox(data); } else { - assert(false); + auto avail = alloc.available(); + auto req = sizeof(DRepr); + + std::cout << "panic: unable to allocate for abox" + << " :req " << req << " :avail " << avail + << std::endl; + std::terminate(); return abox(); }