41 _pool_init_fixed (
void **pool_ptr,
u32 elt_size,
u32 max_elts)
68 total_size = vector_size + free_index_size;
72 total_size = (total_size + page_size - 1) & ~(page_size - 1);
76 mmap_base = mmap (0, total_size, PROT_READ | PROT_WRITE,
77 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
79 if (mmap_base == MAP_FAILED)
102 fi = (
u32 *) (vh + 1);
114 for (i = max_elts; i < set_bits; i++)
118 for (i = 0; i < max_elts; i++)
119 fi[i] = (max_elts - 1) -
i;
Fixed length block allocator.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
static_always_inline uword clib_mem_get_page_size(void)
static uword vec_header_bytes(uword header_bytes)
#define clib_bitmap_alloc(v, n_bits)
Allocate a bitmap with the supplied number of bits.
#define pool_aligned_header_bytes
Align pool header so that pointers are naturally aligned.
sll srl srl sll sra u16x4 i
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define clib_unix_warning(format, args...)
#define CLIB_CACHE_LINE_BYTES