+ //now we can order by total size.
+ std::vector<std::pair<std::string, buff_leak>> leaks;
+ std::copy(leaks_aggreg.begin(),
+ leaks_aggreg.end(),
+ std::back_inserter<std::vector<std::pair<std::string, buff_leak>>>(leaks));
+ std::sort(leaks.begin(), leaks.end(), [](auto const& a, auto const& b) { return a.second.total_size > b.second.total_size; });
+
+ unsigned int i =0;
+ for (const auto& p : leaks) {
+ if(p.second.min_size == p.second.max_size)
+ XBT_INFO("%s of total size %zu, called %d times, each with size %zu",
+ p.first.c_str(),p.second.total_size,p.second.count,p.second.min_size);
+ else
+ XBT_INFO("%s of total size %zu, called %d times, with minimum size %zu and maximum size %zu",
+ p.first.c_str(),p.second.total_size,p.second.count,p.second.min_size,p.second.max_size);
+ i++;
+ if(i == max)
+ break;
+ }
+ if (max < leaks_aggreg.size())