Go to the source code of this file.
|
#define | HEAP_ELT_FREE_BIT (1 << 31) |
|
#define | HEAP_LOG2_SMALL_BINS (5) |
|
#define | HEAP_SMALL_BINS (1 << HEAP_LOG2_SMALL_BINS) |
|
#define | HEAP_N_BINS (2 * HEAP_SMALL_BINS) |
|
#define | HEAP_IS_STATIC (1) |
|
#define | HEAP_DATA_ALIGN (CLIB_CACHE_LINE_BYTES) |
|
#define | heap_dup(v) _heap_dup(v, vec_len (v) * sizeof (v[0])) |
|
#define | heap_new(v) (v) = _heap_new (0, sizeof ((v)[0])) |
|
#define | heap_foreach(var, len, heap, body) |
|
#define | heap_elt_at_index(v, index) vec_elt_at_index(v,index) |
|
#define | heap_elt_with_handle(v, handle) |
|
#define | heap_alloc_aligned(v, size, align, handle) |
|
#define | heap_alloc(v, size, handle) heap_alloc_aligned((v),(size),0,(handle)) |
|
#define | heap_free(v) (v)=_heap_free(v) |
|
|
static uword | heap_is_free (heap_elt_t *e) |
|
static uword | heap_offset (heap_elt_t *e) |
|
static heap_elt_t * | heap_next (heap_elt_t *e) |
|
static heap_elt_t * | heap_prev (heap_elt_t *e) |
|
static uword | heap_elt_size (void *v, heap_elt_t *e) |
|
static heap_header_t * | heap_header (void *v) |
|
static uword | heap_header_bytes () |
|
static void | heap_dup_header (heap_header_t *old, heap_header_t *new) |
|
static uword | heap_elts (void *v) |
|
uword | heap_bytes (void *v) |
|
static void | heap_set_format (void *v, format_function_t *format_elt) |
|
static void | heap_set_max_len (void *v, uword max_len) |
|
static uword | heap_get_max_len (void *v) |
|
static void * | heap_create_from_memory (void *memory, uword max_len, uword elt_bytes) |
|
static heap_elt_t * | heap_get_elt (void *v, uword handle) |
|
static uword | heap_is_free_handle (void *v, uword heap_handle) |
|
uword | heap_len (void *v, word handle) |
|
void | heap_dealloc (void *v, uword handle) |
|
void | heap_validate (void *v) |
|
u8 * | format_heap (u8 *s, va_list *va) |
|
◆ heap_alloc
◆ heap_alloc_aligned
#define heap_alloc_aligned |
( |
|
v, |
|
|
|
size, |
|
|
|
align, |
|
|
|
handle |
|
) |
| |
Value:({ \
uword _o, _h; \
uword _a = (align); \
(v) = _heap_alloc ((v), _s, _a, sizeof ((v)[0]), &_o, &_h); \
(handle) = _h; \
_o; \
})
Definition at line 327 of file heap.h.
◆ HEAP_DATA_ALIGN
◆ heap_dup
#define heap_dup |
( |
|
v | ) |
_heap_dup(v, vec_len (v) * sizeof (v[0])) |
◆ heap_elt_at_index
◆ HEAP_ELT_FREE_BIT
#define HEAP_ELT_FREE_BIT (1 << 31) |
◆ heap_elt_with_handle
#define heap_elt_with_handle |
( |
|
v, |
|
|
|
handle |
|
) |
| |
Value:({ \
})
static heap_elt_t * heap_get_elt(void *v, uword handle)
static uword heap_offset(heap_elt_t *e)
Definition at line 307 of file heap.h.
◆ heap_foreach
#define heap_foreach |
( |
|
var, |
|
|
|
len, |
|
|
|
heap, |
|
|
|
body |
|
) |
| |
Value:do { \
{ \
heap_elt_t * _e = _h->elts + _h->head; \
heap_elt_t * _end = _h->elts + _h->tail; \
while (1) \
{ \
{ \
do { body; } while (0); \
} \
if (_e == _end) \
break; \
} \
} \
} while (0)
static uword heap_is_free(heap_elt_t *e)
static heap_elt_t * heap_next(heap_elt_t *e)
static uword heap_offset(heap_elt_t *e)
static uword heap_elt_size(void *v, heap_elt_t *e)
static heap_header_t * heap_header(void *v)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition at line 274 of file heap.h.
◆ heap_free
#define heap_free |
( |
|
v | ) |
(v)=_heap_free(v) |
◆ HEAP_IS_STATIC
#define HEAP_IS_STATIC (1) |
◆ HEAP_LOG2_SMALL_BINS
#define HEAP_LOG2_SMALL_BINS (5) |
◆ HEAP_N_BINS
◆ heap_new
#define heap_new |
( |
|
v | ) |
(v) = _heap_new (0, sizeof ((v)[0])) |
◆ HEAP_SMALL_BINS
◆ format_heap()
u8* format_heap |
( |
u8 * |
s, |
|
|
va_list * |
va |
|
) |
| |
◆ heap_bytes()
uword heap_bytes |
( |
void * |
v | ) |
|
◆ heap_create_from_memory()
static void* heap_create_from_memory |
( |
void * |
memory, |
|
|
uword |
max_len, |
|
|
uword |
elt_bytes |
|
) |
| |
|
inlinestatic |
◆ heap_dealloc()
void heap_dealloc |
( |
void * |
v, |
|
|
uword |
handle |
|
) |
| |
◆ heap_dup_header()
◆ heap_elt_size()
◆ heap_elts()
static uword heap_elts |
( |
void * |
v | ) |
|
|
inlinestatic |
◆ heap_get_elt()
◆ heap_get_max_len()
static uword heap_get_max_len |
( |
void * |
v | ) |
|
|
inlinestatic |
◆ heap_header()
◆ heap_header_bytes()
static uword heap_header_bytes |
( |
| ) |
|
|
inlinestatic |
◆ heap_is_free()
◆ heap_is_free_handle()
static uword heap_is_free_handle |
( |
void * |
v, |
|
|
uword |
heap_handle |
|
) |
| |
|
inlinestatic |
◆ heap_len()
◆ heap_next()
◆ heap_offset()
◆ heap_prev()
◆ heap_set_format()
◆ heap_set_max_len()
static void heap_set_max_len |
( |
void * |
v, |
|
|
uword |
max_len |
|
) |
| |
|
inlinestatic |
◆ heap_validate()
void heap_validate |
( |
void * |
v | ) |
|