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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-05-30 11:40:37 +02:00
parent c544fc319c
commit 43874aa7bb
+1 -1
View File
@@ -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),