summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-09-12 16:19:47 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-05-30 11:40:37 +0200
commit43874aa7bb6cf04d8bdc3593b2af05be1e1e97b7 (patch)
tree45d47803479d7fe801e2c7a440e4342f092853ad
parentc544fc319c53a07f108dbfe62468b11909ca96d9 (diff)
downloadsystemd-43874aa7bb6cf04d8bdc3593b2af05be1e1e97b7.tar.gz
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.
-rw-r--r--src/basic/hashmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c
index efbe95bb9e..bbb7546093 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),