From 43874aa7bb6cf04d8bdc3593b2af05be1e1e97b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 12 Sep 2019 16:19:47 +0200 Subject: [PATCH] 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. --- src/basic/hashmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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), -- 2.39.5