Function

IdeHeapnew

Declaration

IdeHeap*
ide_heap_new (
  guint element_size,
  GCompareFunc compare_func
)

Description

Creates a new IdeHeap. A heap is a tree-like structure stored in an array that is not fully sorted, but head is guaranteed to be either the max, or min value based on compare_func. This is also known as a priority queue.

Parameters

element_size

Type: guint

The size of each element in the heap.

compare_func

Type: GCompareFunc

A function to compare to elements.

Return value

Type: IdeHeap

A newly allocated IdeHeap.

The caller of the function takes ownership of the data, and is responsible for freeing it.