vppinfra: add vec_new_heap()
[vpp.git] / src / vppinfra / test_vec.c
index 28d945e..f32cd7f 100644 (file)
@@ -221,8 +221,7 @@ dump_call_stats (uword * stats)
     if (_v (l) == ~0)                                                         \
       _v (l) = bounded_random_u32 (&(seed), 0, MAX_VEC_LEN);                  \
                                                                               \
-    _v (v) =                                                                  \
-      _vec_resize (NULL, _v (l), _v (l) * sizeof (elt_type), _v (h), 0);      \
+    _v (v) = _vec_realloc (NULL, _v (l), sizeof (elt_type), _v (h), 0, 0);    \
     fill_with_random_data (_v (v), vec_bytes (_v (v)), (seed));               \
                                                                               \
     /* Fill header with random data as well. */                               \
@@ -259,7 +258,7 @@ validate_vec_free (elt_t * vec)
 static elt_t *
 validate_vec_free_h (elt_t * vec, uword hdr_bytes)
 {
-  vec_free_h (vec, hdr_bytes);
+  vec_free (vec);
   ASSERT (vec == NULL);
   return vec;
 }
@@ -677,7 +676,7 @@ validate_vec_init_h (uword num_elts, uword hdr_bytes)
   uword len;
   elt_t *new;
 
-  new = vec_new_ha (elt_t, num_elts, hdr_bytes, 0);
+  new = vec_new_generic (elt_t, num_elts, hdr_bytes, 0, 0);
   len = vec_len (new);
 
   ASSERT (len == num_elts);
@@ -799,7 +798,7 @@ run_validator_wh (uword iter)
        {
        case OP_IS_VEC_INIT_H:
          num_elts = bounded_random_u32 (&g_seed, 0, MAX_CHANGE);
-         vec_free_h (vec, sizeof (hdr_t));
+         vec_free (vec);
          VERBOSE2 ("vec_init_h(), new elts %d\n", num_elts);
          vec = validate_vec_init_h (num_elts, sizeof (hdr_t));
          break;
@@ -840,7 +839,7 @@ run_validator_wh (uword iter)
     }
 
   validate_vec (vec, sizeof (hdr_t));
-  vec_free_h (vec, sizeof (hdr_t));
+  vec_free (vec);
 }
 
 static void