en:docs:win16:api:kernel:localcountfree

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
en:docs:win16:api:kernel:localcountfree [2026/03/04 06:58] prokusheven:docs:win16:api:kernel:localcountfree [2026/03/04 07:01] (current) prokushev
Line 2: Line 2:
  
 ====== LocalCountFree ====== ====== LocalCountFree ======
-==== Brief ==== +===== Brief ===== 
-Returns the number of free entries (or free space) in the local heap.+Returns the size, in bytes, of the free area in the current local heap.
  
-==== Syntax ==== +===== Syntax ===== 
-<code c>UINT WINAPI LocalCountFree( +<code c>WORD FAR PASCAL LocalCountFree(void);</code>
-HANDLE hHeap +
-);</code>+
  
-==== Parameters ====+===== Parameters ====
 +This function has no parameters.
  
-hHeap – Handle (selector) of the segment that contains the local heap. If hHeap is zero, the function operates on the current data segment (DGROUP) .+===== Return Value ===== 
 +Returns the size, in bytes, of the free area in the current local heap. The "current" heap is the one whose data segment selector is loaded into the DS register at the time of the call.
  
-==== Return Value ==== +===== Notes =====
-Returns the number of free entries (or free bytes) in the local heap. The exact meaning of the return value is not documented.+
  
-==== Notes ====+In normal use, called from within a module, it returns the free space in that module's own local heap.
  
-Presumably, the function was used for debugging or monitoring the state of the local heap, allowing a program to determine the degree of fragmentation. +===== Example Code =====
- +
- +
-==== Example Code ====+
 ==== C Binding ==== ==== C Binding ====
 <code c>#include <windows.h> <code c>#include <windows.h>
  
-// Hypothetical usage +WORD wFreeBytes = LocalCountFree();</code>
-UINT uFreeCount = LocalCountFree(0);</code>+
 ==== MASM Binding ==== ==== MASM Binding ====
-<code asm>; AX = 0 (current data segment) +<code asm>call LocalCountFree ; Returns AX = free bytes in current local heap</code>
-push ax ; hHeap +
-call LocalCountFree ; Returns AX = number of free entries</code>+
  
-==== See also ====+===== See also =====
  
   * [[LocalSize]]   * [[LocalSize]]
-  * [[LocalFlags]] 
   * [[LocalCompact]]   * [[LocalCompact]]
 +
  
  
 {{page>en:templates:win16}} {{page>en:templates:win16}}