The HT_FOREACH() is insanely heavy on the CPU and this is part of the fast
path so make it return the nice memory size counter we added in
4d812e29b9b1ec88.
Fixes #25148
Signed-off-by: David Goulet <dgoulet@torproject.org>
size_t
geoip_client_cache_total_allocation(void)
{
- size_t bytes = 0;
- clientmap_entry_t **ent;
-
- HT_FOREACH(ent, clientmap, &client_history) {
- bytes += clientmap_entry_size(*ent);
- }
- return bytes;
+ return geoip_client_history_cache_size;
}
/** How many responses are we giving to clients requesting v3 network