/* Simple insertion-only static-sized priority heap containing pointers, based on CLR, chapter 7  */
int heap_init(struct ptr_heap *heap, size_t size, gfp_t gfp_mask, int(*gt)(void *, void *))
/* Simple insertion-only static-sized priority heap containing pointers, based on CLR, chapter 7  */
int heap_init(struct ptr_heap *heap, size_t size, gfp_t gfp_mask, int(*gt)(void *, void *))
{
	heap->ptrs = kmalloc(size, gfp_mask);
	if (!heap->ptrs)
		return -ENOMEM;
	heap->size = 0;
	heap->max = size / sizeof(void *);
	heap->gt = gt;
	return 0;
}