nat: nat44-ed cleanup & fixes
[vpp.git] / src / vppinfra / ring.h
index be61dc4..d7e1915 100644 (file)
@@ -29,7 +29,7 @@ typedef struct
 always_inline clib_ring_header_t *
 clib_ring_header (void *v)
 {
-  return vec_aligned_header (v, sizeof (clib_ring_header_t), sizeof (void *));
+  return vec_header (v);
 }
 
 always_inline void
@@ -38,11 +38,11 @@ clib_ring_new_inline (void **p, u32 elt_bytes, u32 size, u32 align)
   void *v;
   clib_ring_header_t *h;
 
-  v = _vec_resize ((void *) 0,
-                  /* length increment */ size,
-                  /* data bytes */ elt_bytes * size,
-                  /* header bytes */ sizeof (h[0]),
-                  /* data align */ align);
+  v = _vec_realloc (0,
+                   /* length increment */ size,
+                   /* data bytes */ elt_bytes,
+                   /* header bytes */ sizeof (h[0]),
+                   /* data align */ align, 0);
 
   h = clib_ring_header (v);
   h->next = 0;
@@ -56,7 +56,7 @@ clib_ring_new_inline (void **p, u32 elt_bytes, u32 size, u32 align)
 #define clib_ring_new(ring, size) \
 { clib_ring_new_inline ((void **)&(ring), sizeof(ring[0]), size, 0);}
 
-#define clib_ring_free(f) vec_free_h((f), sizeof(clib_ring_header_t))
+#define clib_ring_free(f) vec_free ((f))
 
 always_inline u32
 clib_ring_n_enq (void *v)