9 std::vector
<uint8_t> vec(2000, 0);
10 DHAT_HISTOGRAM_MEMORY(vec
.data());
11 std::mt19937
gen(42);;
12 std::uniform_int_distribution
<> index_distrib(0, 1999);
13 std::uniform_int_distribution
<> val_distrib(0, 255);
15 for (int i
= 0; i
< 20; ++i
)
17 int index
= index_distrib(gen
);
18 int val
= val_distrib(gen
);
20 //std::cout << "wrote " << val << " to index " << index << "\n";
23 // try to generate some warnings
26 DHAT_HISTOGRAM_MEMORY(vec
.data());
28 auto old
= vec
.data();
30 // old should have been deleted
31 DHAT_HISTOGRAM_MEMORY(old
);
32 // and this is too big
33 DHAT_HISTOGRAM_MEMORY(vec
.data());