vppinfra: add option to use libexecinfo
[vpp.git] / src / vppinfra / vec.h
index d4063e6..e8146af 100644 (file)
@@ -209,6 +209,21 @@ _vec_resize_will_expand (void *v,
   return 1;
 }
 
+/** \brief Determine if vector will resize with next allocation
+
+    @param V pointer to a vector
+    @param N number of elements to add
+    @return 1 if vector will resize 0 otherwise
+*/
+
+#define vec_resize_will_expand(V, N)                                          \
+  ({                                                                          \
+    word _v (n) = (N);                                                        \
+    word _v (l) = vec_len (V);                                                \
+    _vec_resize_will_expand ((V), _v (n),                                     \
+                            (_v (l) + _v (n)) * sizeof ((V)[0]), 0, 0);      \
+  })
+
 /** \brief Predicate function, says whether the supplied vector is a clib heap
     object (general version).
 
@@ -379,6 +394,8 @@ do {                                                \
 */
 #define vec_free(V) vec_free_h(V,0)
 
+void vec_free_not_inline (void *v);
+
 /**\brief Free vector user header (syntactic sugar)
    @param h vector header
    @void