Differences
This shows you the differences between two versions of the page.
| en:docs:win16:api:kernel:localcompact [2023/05/01 10:44] – created prokushev | en:docs:win16:api:kernel:localcompact [2026/03/04 06:44] (current) – prokushev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{page> | {{page> | ||
| - | ====== | + | ====== |
| + | ==== Brief ==== | ||
| + | Compacts the local heap to satisfy a memory request and returns the size of the largest free block. | ||
| - | ===== Brief ===== | + | ==== Syntax |
| + | <code c>UINT WINAPI LocalCompact( | ||
| + | UINT uMinFree | ||
| + | );</ | ||
| - | ===== Syntax ===== | + | ==== Parameters |
| - | ===== Parameters ===== | + | uMinFree – Minimum amount of free space (in bytes) desired. Can be zero. |
| - | ===== Return | + | ==== Return |
| + | Returns the maximum size of a free block that can be allocated after compaction. | ||
| - | ===== Notes ===== | + | ==== Notes ==== |
| - | ===== Example Code ===== | + | Compaction may move unlocked discardable blocks or discard them entirely. |
| - | ==== C Binding ==== | + | This function is rarely needed because Windows automatically manages the heap. |
| + | ==== Example Code ==== | ||
| + | ==== C Binding ==== | ||
| + | <code c>UINT maxFree = LocalCompact(1024);</ | ||
| ==== MASM Binding ==== | ==== MASM Binding ==== | ||
| + | <code asm>push 1024 | ||
| + | call LocalCompact</ | ||
| + | |||
| + | ==== See also ==== | ||
| + | |||
| + | * [[LocalAlloc]] | ||
| + | * [[LocalDiscard]] | ||
| - | ===== See also ===== | ||
| {{page> | {{page> | ||




