- vlib_buffer_pool_t *bp = &vm->buffer_main->buffer_pools[0];
- n_this_chunk = clib_min (n_remaining, bp->alloc_chunk_size);
-
- n_bytes = n_this_chunk * (sizeof (b[0]) + fl->n_data_bytes);
-
- /* drb: removed power-of-2 ASSERT */
- buffers =
- vm->os_physmem_alloc_aligned (vm, bp->physmem_region, n_bytes,
- sizeof (vlib_buffer_t));
- if (!buffers)
- return n_alloc;
-
- /* Record chunk as being allocated so we can free it later. */
- vec_add1 (fl->buffer_memory_allocated, buffers);
-
- fl->n_alloc += n_this_chunk;
- n_alloc += n_this_chunk;
- n_remaining -= n_this_chunk;