Lines Matching refs:heap
29 nouveau_heap_init(struct nouveau_heap **heap, in nouveau_heap_init() argument
40 *heap = r; in nouveau_heap_init()
45 nouveau_heap_destroy(struct nouveau_heap **heap) in nouveau_heap_destroy() argument
47 if (!*heap) in nouveau_heap_destroy()
49 free(*heap); in nouveau_heap_destroy()
50 *heap = NULL; in nouveau_heap_destroy()
54 nouveau_heap_alloc(struct nouveau_heap *heap, unsigned size, void *priv, in nouveau_heap_alloc() argument
59 if (!heap || !size || !res || *res) in nouveau_heap_alloc()
62 while (heap) { in nouveau_heap_alloc()
63 if (!heap->in_use && heap->size >= size) { in nouveau_heap_alloc()
68 r->start = (heap->start + heap->size) - size; in nouveau_heap_alloc()
73 heap->size -= size; in nouveau_heap_alloc()
75 r->next = heap->next; in nouveau_heap_alloc()
76 if (heap->next) in nouveau_heap_alloc()
77 heap->next->prev = r; in nouveau_heap_alloc()
78 r->prev = heap; in nouveau_heap_alloc()
79 heap->next = r; in nouveau_heap_alloc()
85 heap = heap->next; in nouveau_heap_alloc()