api: fix [un]formatting in vpp/api/types.c
[vpp.git] / src / plugins / lb / lbhash.h
index 375227c..8253e9d 100644 (file)
@@ -20,7 +20,7 @@
  * be 100% reliable (write can fail). It also needs to recycle
  * old entries in a lazy way.
  *
- * This hash table is the most dummy hash table you can do.
+ * This hash table is the most trivial hash table you can do.
  * Fixed total size, fixed bucket size.
  * Advantage is that it could be very efficient (maybe).
  *
@@ -88,8 +88,7 @@ lb_hash_t *lb_hash_alloc(u32 buckets, u32 timeout)
       sizeof(lb_hash_bucket_t) * (buckets + 1);
   u8 *mem = 0;
   lb_hash_t *h;
-  vec_alloc_aligned(mem, size, CLIB_CACHE_LINE_BYTES);
-  clib_memset(mem, 0, size);
+  vec_validate_aligned (mem, size - 1, CLIB_CACHE_LINE_BYTES);
   h = (lb_hash_t *)mem;
   h->buckets_mask = (buckets - 1);
   h->timeout = timeout;