+int heap_init(struct ptr_heap *heap, size_t alloc_len,
+ gfp_t gfpmask, int gt(void *a, void *b))
+{
+ heap->ptrs = NULL;
+ heap->len = 0;
+ heap->alloc_len = 0;
+ heap->gt = gt;
+ /*
+ * Minimum size allocated is 1 entry to ensure memory allocation
+ * never fails within heap_replace_max.
+ */
+ return heap_grow(heap, min_t(size_t, 1, alloc_len));
+}
+