MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / cnt_dist

Function cnt_dist

libCacheSim/profiler/dist.c:245–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void cnt_dist(const int32_t *dist_array, const int64_t array_size,
246 GHashTable *hash_table) {
247 for (int64_t i = 0; i < array_size; i++) {
248 int64_t dist = dist_array[i] == -1 ? INT64_MAX : dist_array[i];
249 gpointer gp_dist = GSIZE_TO_POINTER((gsize)dist);
250 int64_t old_cnt = (int64_t)g_hash_table_lookup(hash_table, gp_dist);
251 g_hash_table_replace(hash_table, gp_dist, GSIZE_TO_POINTER(old_cnt + 1));
252 }
253}
254
255void _write_dist_cnt(gpointer k, gpointer v, gpointer user_data) {
256 int64_t dist = (int64_t)GPOINTER_TO_SIZE(k);

Callers 1

save_dist_as_cnt_txtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected