git » nmdb » commit 4c8503d

Set the number of objects in cache_create().

author Alberto Bertogli
2007-07-21 22:44:08 UTC
committer Alberto Bertogli
2007-07-21 22:44:08 UTC
parent 0d5b657c22ff01944b835ba687eabcca90376c0b

Set the number of objects in cache_create().

Today, the numobjs struct member is unused, but it should be properly
filled anyway.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

nmdb/cache.c +1 -0

diff --git a/nmdb/cache.c b/nmdb/cache.c
index 59538b3..d1e36ac 100644
--- a/nmdb/cache.c
+++ b/nmdb/cache.c
@@ -27,6 +27,7 @@ struct cache *cache_create(size_t numobjs, unsigned int flags)
 	 * an arbitrary number. It's long enough to make LRU useful, and small
 	 * enough to make lookups fast. */
 	cd->chainlen = 4;
+	cd->numobjs = numobjs;
 	cd->hashlen = numobjs / cd->chainlen;
 
 	cd->table = (struct cache_chain *)