xo-alloc2: abox: nice message on alloc fail
This commit is contained in:
parent
99f5fd9c5e
commit
95add0cc0e
1 changed files with 8 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue