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) |
|
|
always_inline uword | heap_is_free (heap_elt_t *e) |
|
always_inline uword | heap_offset (heap_elt_t *e) |
|
always_inline heap_elt_t * | heap_next (heap_elt_t *e) |
|
always_inline heap_elt_t * | heap_prev (heap_elt_t *e) |
|
always_inline uword | heap_elt_size (void *v, heap_elt_t *e) |
|
always_inline heap_header_t * | heap_header (void *v) |
|
always_inline uword | heap_header_bytes () |
|
always_inline void | heap_dup_header (heap_header_t *old, heap_header_t *new) |
|
always_inline uword | heap_elts (void *v) |
|
uword | heap_bytes (void *v) |
|
always_inline void | heap_set_format (void *v, format_function_t *format_elt) |
|
always_inline void | heap_set_max_len (void *v, uword max_len) |
|
always_inline uword | heap_get_max_len (void *v) |
|
always_inline void * | heap_create_from_memory (void *memory, uword max_len, uword elt_bytes) |
|
always_inline heap_elt_t * | heap_get_elt (void *v, uword handle) |
|
always_inline 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) |
|
#define heap_alloc_aligned |
( |
|
v, |
|
|
|
size, |
|
|
|
align, |
|
|
|
handle |
|
) |
| |
Value: (v) = _heap_alloc ((v), _s, _a, sizeof ((v)[0]), &_o, &_h); \
(handle) = _h; \
_o; \
})
Definition at line 299 of file heap.h.
#define heap_dup |
( |
|
v | ) |
_heap_dup(v, vec_len (v) * sizeof (v[0])) |
#define HEAP_ELT_FREE_BIT (1 << 31) |
#define heap_elt_with_handle |
( |
|
v, |
|
|
|
handle |
|
) |
| |
Value:({ \
})
always_inline heap_elt_t * heap_get_elt(void *v, uword handle)
always_inline uword heap_offset(heap_elt_t *e)
Definition at line 278 of file heap.h.
#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)
always_inline heap_elt_t * heap_next(heap_elt_t *e)
always_inline uword heap_is_free(heap_elt_t *e)
always_inline heap_header_t * heap_header(void *v)
always_inline uword heap_offset(heap_elt_t *e)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
always_inline uword heap_elt_size(void *v, heap_elt_t *e)
Definition at line 245 of file heap.h.
#define heap_free |
( |
|
v | ) |
(v)=_heap_free(v) |
#define HEAP_IS_STATIC (1) |
#define HEAP_LOG2_SMALL_BINS (5) |
#define heap_new |
( |
|
v | ) |
(v) = _heap_new (0, sizeof ((v)[0])) |
u8* format_heap |
( |
u8 * |
s, |
|
|
va_list * |
va |
|
) |
| |