HeapCompact function kernel32

Win32Result<int> HeapCompact(
  1. HANDLE hHeap,
  2. HEAP_FLAGS dwFlags
)

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.

To learn more, see learn.microsoft.com/windows/win32/api/heapapi/nf-heapapi-heapcompact.

Implementation

Win32Result<int> HeapCompact(HANDLE hHeap, HEAP_FLAGS dwFlags) {
  final result_ = HeapCompact_Wrapper(hHeap, dwFlags);
  return .new(value: result_.value.i64, error: result_.error);
}