This will allow `calc_hash()` to be used for other purposes than
the loadavg implementation.
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
hash ^= (x >> 24);
hash &= ~x;
}
hash ^= (x >> 24);
hash &= ~x;
}
- return ((hash & 0x7fffffff) % LOAD_SIZE);
+ return (hash & 0x7fffffff);
return read_file("/proc/loadavg", buf, size, d);
prune_init_slice(cg);
return read_file("/proc/loadavg", buf, size, d);
prune_init_slice(cg);
+ hash = calc_hash(cg) % LOAD_SIZE;
n = locate_node(cg, hash);
/* First time */
n = locate_node(cg, hash);
/* First time */