From: Zbigniew Jędrzejewski-Szmek Date: Thu, 12 Sep 2019 14:19:47 +0000 (+0200) Subject: hashmap: don't allow hashmap_type_info table to be optimized away X-Git-Tag: v246-rc1~193^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43874aa7bb6cf04d8bdc3593b2af05be1e1e97b7;p=thirdparty%2Fsystemd.git hashmap: don't allow hashmap_type_info table to be optimized away This makes debugging hashmaps harder, because we can't query the size. Make sure that table is always present. --- diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index efbe95bb9e3..bbb75460937 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -254,7 +254,7 @@ struct hashmap_type_info { unsigned n_direct_buckets; }; -static const struct hashmap_type_info hashmap_type_info[_HASHMAP_TYPE_MAX] = { +static _used_ const struct hashmap_type_info hashmap_type_info[_HASHMAP_TYPE_MAX] = { [HASHMAP_TYPE_PLAIN] = { .head_size = sizeof(Hashmap), .entry_size = sizeof(struct plain_hashmap_entry),