Lines Matching refs:heap
124 malloc_elem_init(struct malloc_elem *elem, struct malloc_heap *heap, in malloc_elem_init() argument
128 elem->heap = heap; in malloc_elem_init()
147 struct malloc_heap *heap = elem->heap; in malloc_elem_insert() local
150 if ((heap->first == NULL) != (heap->last == NULL)) { in malloc_elem_insert()
155 if (heap->first == NULL && heap->last == NULL) { in malloc_elem_insert()
157 heap->first = elem; in malloc_elem_insert()
158 heap->last = elem; in malloc_elem_insert()
161 } else if (elem < heap->first) { in malloc_elem_insert()
164 next_elem = heap->first; in malloc_elem_insert()
165 heap->first = elem; in malloc_elem_insert()
166 } else if (elem > heap->last) { in malloc_elem_insert()
168 prev_elem = heap->last; in malloc_elem_insert()
170 heap->last = elem; in malloc_elem_insert()
175 dist_from_end = RTE_PTR_DIFF(heap->last, elem); in malloc_elem_insert()
176 dist_from_start = RTE_PTR_DIFF(elem, heap->first); in malloc_elem_insert()
180 prev_elem = heap->first; in malloc_elem_insert()
185 next_elem = heap->last; in malloc_elem_insert()
297 malloc_elem_init(split_pt, elem->heap, elem->msl, new_elem_size, in split_elem()
304 elem->heap->last = split_pt; in split_elem()
328 elem->heap->last = prev; in remove_elem()
332 elem->heap->first = next; in remove_elem()
409 LIST_INSERT_HEAD(&elem->heap->free_head[idx], elem, free_list); in malloc_elem_free_list_insert()
449 if (elem == elem->heap->last) in malloc_elem_alloc()
450 elem->heap->last = new_free_elem; in malloc_elem_alloc()
502 elem1->heap->last = elem1; in join_elem()
593 elem->heap->alloc_count--; in malloc_elem_free()