29        void *trace[ALLOC_TRACE_DEPTH];
 
   31        backtrace(
const backtrace &) = 
default;
 
   32        explicit backtrace(
void **bt) { memcpy(trace, bt, 
sizeof(trace)); }
 
   33        bool operator<(
const backtrace &a)
 const {
 
   34            for (
int i = 0; i < ALLOC_TRACE_DEPTH; ++i)
 
   35                if (trace[i] != a.trace[i]) 
return trace[i] < a.trace[i];
 
   38        bool operator==(
const backtrace &a)
 const {
 
   39            for (
int i = 0; i < ALLOC_TRACE_DEPTH; ++i)
 
   40                if (trace[i] != a.trace[i]) 
return false;
 
   44    std::map<backtrace, std::map<size_t, int>> data;
 
   45    void count(
void **, 
size_t);
 
   46    static void callback(
void *t, 
void **bt, 
size_t sz) {
 
   51    void clear() { data.clear(); }
 
   55        auto tmp = set_alloc_trace(old);
 
   56        BUG_CHECK(tmp.fn == callback && tmp.arg == 
this, 
"AllocTrace stopped when not running");
 
   60        BUG(
"Can't trace allocations without garbage collection");
 
   65    friend std::ostream &operator<<(std::ostream &, 
const AllocTrace &);