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