en:docs:win16:api:kernel:localcompact

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:docs:win16:api:kernel:localcompact [2023/05/01 10:44] – created prokusheven:docs:win16:api:kernel:localcompact [2026/03/04 06:44] (current) prokushev
Line 1: Line 1:
 {{page>en:templates:win16api}} {{page>en:templates:win16api}}
  
-======  ======+====== LocalCompact ====== 
 +==== 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 
 +);</code>
  
-===== Syntax =====+==== Parameters ====
  
-===== Parameters =====+uMinFree – Minimum amount of free space (in bytes) desired. Can be zero.
  
-===== Return Code =====+==== Return Value ==== 
 +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);</code>
 ==== MASM Binding ==== ==== MASM Binding ====
 +<code asm>push 1024
 +call LocalCompact</code>
 +
 +==== See also ====
 +
 +  * [[LocalAlloc]]
 +  * [[LocalDiscard]]
  
-===== See also ===== 
  
 {{page>en:templates:win16}} {{page>en:templates:win16}}