13.11 The HEAPSIZE Statement

The HEAPSIZE statement defines the size of the application or DLL's local heap in bytes. This value affects the size of the default data segment (DGROUP). The default without HEAPSIZE is no local heap.

Syntax

HEAPSIZE {bytes|MAXVAL}

Remarks

The bytes field accepts a positive integer in decimal or C-language notation. The limit is MAXVAL; if bytes exceeds MAXVAL, the excess is not allocated.

MAXVAL is a keyword that sets the heap size to 64K minus the size of DGROUP. This is useful in bound applications when you want to force a 64K requirement for DGROUP for the program in DOS. The bound program fails to load if 64K of memory is not available.

Example

The following example sets the local heap to 4,000 bytes:

HEAPSIZE 4000