summaryrefslogtreecommitdiff
path: root/lib/qobj.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-03 18:50:35 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-09-05 14:33:01 -0400
commitbd74dc610a2069f8549a26668940ef655f51598d (patch)
treec22aae3216f8c6ac50466ab8ce83fd58b7f9d77c /lib/qobj.c
parentf24fdd9921b98f99d63b1299029d177954090243 (diff)
lib: Hash creation cleanup
1) Some hash key functions where converting pointers directly to a 32 bit value via downcasting. Pointers are 64 bit on a majority of our platforms. 2) Some hashes were being created with 256 entries, downsize the hash creation size to more appropriate values. 3) Add hash names to hash creation so we can watch the hash via 'show debugging hashtable' Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/qobj.c')
-rw-r--r--lib/qobj.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/qobj.c b/lib/qobj.c
index 5f450ca0d3..c75002052e 100644
--- a/lib/qobj.c
+++ b/lib/qobj.c
@@ -25,6 +25,7 @@
#include "hash.h"
#include "log.h"
#include "qobj.h"
+#include "jhash.h"
static pthread_rwlock_t nodes_lock;
static struct hash *nodes = NULL;
@@ -97,7 +98,9 @@ void qobj_init(void)
{
if (!nodes) {
pthread_rwlock_init(&nodes_lock, NULL);
- nodes = hash_create(qobj_key, qobj_cmp, NULL);
+ nodes = hash_create_size(16, qobj_key,
+ qobj_cmp,
+ "QOBJ Hash");
}
}