Lines Matching refs:heap
29 static const char rcsid[] = "$Id: heap.c,v 1.4 2006/03/09 23:57:56 marka Exp $";
40 #include <isc/heap.h>
44 * element of the heap array is not used; i.e. heap subscripts are 1-based,
70 ctx->heap = NULL;
83 if (ctx->heap != NULL)
84 free(ctx->heap);
95 new_heap = (void **)realloc(ctx->heap,
101 ctx->heap = new_heap;
110 i > 1 && ctx->higher_priority(elt, ctx->heap[p]);
112 ctx->heap[i] = ctx->heap[p];
114 (ctx->index)(ctx->heap[i], i);
116 ctx->heap[i] = elt;
118 (ctx->index)(ctx->heap[i], i);
130 if (j < size && ctx->higher_priority(ctx->heap[j+1],
131 ctx->heap[j]))
133 if (ctx->higher_priority(elt, ctx->heap[j]))
135 ctx->heap[i] = ctx->heap[j];
137 (ctx->index)(ctx->heap[i], i);
140 ctx->heap[i] = elt;
142 (ctx->index)(ctx->heap[i], i);
176 elt = ctx->heap[ctx->heap_size--];
177 less = ctx->higher_priority(elt, ctx->heap[i]);
178 ctx->heap[i] = elt;
180 float_up(ctx, i, ctx->heap[i]);
182 sink_down(ctx, i, ctx->heap[i]);
195 float_up(ctx, i, ctx->heap[i]);
207 sink_down(ctx, i, ctx->heap[i]);
219 return (ctx->heap[i]);
232 (action)(ctx->heap[i], uap);