From 7398282096ba4a74b11c18082cab7db32c2b0da1 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Mon, 15 Sep 2014 16:43:59 -0400 Subject: hashmap: introduce hash_ops to make struct Hashmap smaller It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory. Signed-off-by: Anthony G. Basile --- src/shared/cgroup-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared/cgroup-util.c') diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c index 76ab747292..3f9018cf1f 100644 --- a/src/shared/cgroup-util.c +++ b/src/shared/cgroup-util.c @@ -84,7 +84,7 @@ int cg_kill(const char *controller, const char *path, int sig, bool sigcont, boo * tasks list, to properly handle forking processes */ if (!s) { - s = allocated_set = set_new(trivial_hash_func, trivial_compare_func); + s = allocated_set = set_new(NULL); if (!s) return -ENOMEM; } -- cgit v1.2.3-54-g00ecf