1 /* SPDX-License-Identifier: Apache-2.0
2 * Copyright(c) 2023 Yandex LLC.
5 #include <vppinfra/pool.h>
7 /* can be a very large size */
11 main (int argc, char *argv[])
18 clib_mem_init (0, 3ULL << 30);
20 vec_validate (indices, NELTS - 1);
21 vec_set_len (indices, 0);
23 /* zero size allocation is ok */
26 fformat (stdout, "%d pool elts of empty pool\n", pool_elts (tp));
30 pool_alloc (tp, NELTS);
32 for (i = 0; i < NELTS; i++)
35 vec_add1 (indices, junk - tp);
39 for (i = 0; i < NELTS; i++)
41 junk = pool_elt_at_index (tp, indices[i]);
45 fformat (stdout, "%d pool elts before deletes\n", pool_elts (tp));
47 pool_put_index (tp, indices[12]);
48 pool_put_index (tp, indices[43]);
50 fformat (stdout, "%d pool elts after deletes\n", pool_elts (tp));