Function CFBinaryHeapCreateCopy

Source
pub unsafe extern "C-unwind" fn CFBinaryHeapCreateCopy(
    allocator: Option<&CFAllocator>,
    capacity: CFIndex,
    heap: Option<&CFBinaryHeap>,
) -> Option<CFRetained<CFBinaryHeap>>
Available on crate features CFBase and CFBinaryHeap only.
Expand description

Creates a new mutable binary heap with the values from the given binary heap.

Parameter allocator: The CFAllocator which should be used to allocate memory for the binary heap and its storage for values. This parameter may be NULL in which case the current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined.

Parameter capacity: A hint about the number of values that will be held by the CFBinaryHeap. Pass 0 for no hint. The implementation may ignore this hint, or may use it to optimize various operations. A heap’s actual capacity is only limited by address space and available memory constraints). This parameter must be greater than or equal to the count of the heap which is to be copied, or the behavior is undefined. If this parameter is negative, the behavior is undefined.

Parameter heap: The binary heap which is to be copied. The values from the binary heap are copied as pointers into the new binary heap (that is, the values themselves are copied, not that which the values point to, if anything). However, the values are also retained by the new binary heap. The count of the new binary will be the same as the given binary heap. The new binary heap uses the same callbacks as the binary heap to be copied. If this parameter is not a valid CFBinaryHeap, the behavior is undefined.

Returns: A reference to the new mutable binary heap.