_heapmin Functions

Description

Release unused heap memory to the operating system.

#include <malloc.h>

int _heapmin( void );

int _bheapmin( __segment seg )

int _fheapmin( void );

int _nheapmin( void );

seg Specified based-heap selector  

Remarks

The _heapmin functions minimize the heap by releasing unused heap memory to the operating system.

The various _heapmin functions release unused memory in these heaps:

Function Heap Minimized

_heapmin Depends on data model of program.
_bheapmin Based heap specified by seg value; _NULLSEG specifies all based heaps.
_fheapmin Far heap (outside default data segment).
_nheapmin Near heap (inside default data segment).

In large data models (that is, compact-, large-, and huge-model programs), _heapmin maps to _fheapmin. In small data models (tiny-, small-, and medium-model programs), _heapmin maps to _nheapmin.

For _heapmin, if the supplied seg value is _NULLSEG, all based heap segments are minimized; otherwise, only the specified one is minimized.

Based-heap segments are never freed (i.e., unlinked from the based heap list and released back to the operating system) by the _bheapmin function. The _bfreeseg function is used for that purpose.

Return Value

The _heapmin functions return 0 if the function completed successfully, or –1 in the case of an error.

Compatibility

_heapmin

Standards:None

16-Bit:DOS, QWIN, WIN, WIN DLL

32-Bit:DOS32X

_bheapmin, _fheapmin, _nheapmin

Standards:None

16-Bit:DOS, QWIN, WIN, WIN DLL

32-Bit:None

See Also

_bfreeseg, free functions, malloc functions