xo-alloc2: abox: nice message on alloc fail

This commit is contained in:
Roland Conybeare 2026-03-25 21:12:23 -04:00
commit 95add0cc0e

View file

@ -7,6 +7,7 @@
#include "Allocator.hpp"
#include <xo/facet/obj.hpp>
#include <exception>
#include <cassert>
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();
}