summaryrefslogtreecommitdiffstats
path: root/src/osx/btop_collect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osx/btop_collect.cpp')
-rw-r--r--src/osx/btop_collect.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/osx/btop_collect.cpp b/src/osx/btop_collect.cpp
index adbeb35..361aa4a 100644
--- a/src/osx/btop_collect.cpp
+++ b/src/osx/btop_collect.cpp
@@ -45,6 +45,7 @@ tab-size = 4
#include <netinet/in.h> // for inet_ntop
#include <unistd.h>
#include <stdexcept>
+#include <utility>
#include <cmath>
#include <fstream>
@@ -98,7 +99,7 @@ namespace Cpu {
string cpu_sensor;
vector<string> core_sensors;
- unordered_flat_map<int, int> core_mapping;
+ std::unordered_map<int, int> core_mapping;
} // namespace Cpu
namespace Mem {
@@ -194,7 +195,7 @@ namespace Cpu {
const array<string, 10> time_names = {"user", "nice", "system", "idle"};
- unordered_flat_map<string, long long> cpu_old = {
+ std::unordered_map<string, long long> cpu_old = {
{"totals", 0},
{"idles", 0},
{"user", 0},
@@ -337,8 +338,8 @@ namespace Cpu {
return std::to_string(freq / 1000.0 / 1000.0 / 1000.0).substr(0, 3);
}
- auto get_core_mapping() -> unordered_flat_map<int, int> {
- unordered_flat_map<int, int> core_map;
+ auto get_core_mapping() -> std::unordered_map<int, int> {
+ std::unordered_map<int, int> core_map;
if (cpu_temp_only) return core_map;
natural_t cpu_count;
@@ -599,7 +600,7 @@ namespace Mem {
io_object_t &object;
};
- void collect_disk(unordered_flat_map<string, disk_info> &disks, unordered_flat_map<string, string> &mapping) {
+ void collect_disk(std::unordered_map<string, disk_info> &disks, std::unordered_map<string, string> &mapping) {
io_registry_entry_t drive;
io_iterator_t drive_list;
@@ -716,7 +717,7 @@ namespace Mem {
}
if (show_disks) {
- unordered_flat_map<string, string> mapping; // keep mapping from device -> mountpoint, since IOKit doesn't give us the mountpoint
+ std::unordered_map<string, string> mapping; // keep mapping from device -> mountpoint, since IOKit doesn't give us the mountpoint
double uptime = system_uptime();
auto &disks_filter = Config::getS("disks_filter");
bool filter_exclude = false;
@@ -829,13 +830,13 @@ namespace Mem {
} // namespace Mem
namespace Net {
- unordered_flat_map<string, net_info> current_net;
+ std::unordered_map<string, net_info> current_net;
net_info empty_net = {};
vector<string> interfaces;
string selected_iface;
int errors = 0;
- unordered_flat_map<string, uint64_t> graph_max = {{"download", {}}, {"upload", {}}};
- unordered_flat_map<string, array<int, 2>> max_count = {{"download", {}}, {"upload", {}}};
+ std::unordered_map<string, uint64_t> graph_max = {{"download", {}}, {"upload", {}}};
+ std::unordered_map<string, array<int, 2>> max_count = {{"download", {}}, {"upload", {}}};
bool rescale = true;
uint64_t timestamp = 0;
@@ -912,7 +913,7 @@ namespace Net {
} // else, ignoring family==AF_LINK (see man 3 getifaddrs)
}
- unordered_flat_map<string, std::tuple<uint64_t, uint64_t>> ifstats;
+ std::unordered_map<string, std::tuple<uint64_t, uint64_t>> ifstats;
int mib[] = {CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST2, 0};
size_t len;
if (sysctl(mib, 6, nullptr, &len, nullptr, 0) < 0) {
@@ -986,7 +987,6 @@ namespace Net {
else
it++;
}
- net.compact();
}
timestamp = new_timestamp;
@@ -1057,7 +1057,7 @@ namespace Net {
namespace Proc {
vector<proc_info> current_procs;
- unordered_flat_map<string, string> uid_user;
+ std::unordered_map<string, string> uid_user;
string current_sort;
string current_filter;
bool current_rev = false;