Group: Memory Management - Library: kernel32
Attempts to compact a specified heap. It compacts the heap by coalescing adjacent free blocks of memory and decommitting large free blocks of memory.
Validating the heap of the calling process
UINT HeapCompact(
HANDLE hHeap, // handle to heap
DWORD dwFlags // heap access options
);
DECLARE INTEGER HeapCompact IN kernel32;
INTEGER hHeap,;
INTEGER dwFlags
hHeap [in] Handle to the heap that the function will attempt to compact.
dwFlags [in] Specifies heap access during function operation.
If the function succeeds, the return value is the size, in bytes, of the largest committed free block in the heap. If the function fails, the return value is zero.
Windows NT/2000/XP: Included in Windows NT 3.5 and later.
Windows 95/98/Me: Unsupported.