Kernel32HeapCompact Method

Returns the size of the largest committed free block in the specified heap.

If the Disable heap coalesce on free global flag is set, this function also coalesces adjacent free blocks of memory in the heap.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static uint HeapCompact(
	IntPtr hHeap,
	HeapFlags flags
)

Parameters

hHeap  IntPtr
A handle to the heap.

This handle is returned by either the HeapCreate(HeapFlags, UInt32, UInt32) or GetProcessHeap function.

flags  HeapFlags
The heap access options.

Return Value

UInt32
If the function succeeds, the return value is the size of the largest committed free block in the heap, in bytes.

If the function fails, the return value is zero.

In the unlikely case that there is absolutely no space available in the heap, the function return value is zero, and GetLastWin32Error returns zero.

Remarks

See Also