Geoff Chappell - Software Analyst
HEAPSIZE is a single-definition statement. It is a fatal error (LNK1118) if the statement is empty. The HEAPSIZE tag must be followed by a space or tab. There may then be any amount of white space, including none, before the definition. The syntax provides for one or two arguments:
HEAPSIZE reserve[,commit]
HEAPSIZE ,commit
Both are interpreted numerically, in decimal, hexadecimal or octal notation, with a sign prefix permitted, but evaluated as unsigned integers truncated to 64 bits.
If the first character of the definition is a comma, then only commit is expected. If the first comma is elsewhere, then the definition must provide both a reserve and a commit. There may be any amount of white space, including none, between the comma and commit. With no comma, only reserve is expected. Excess characters, including non-numerical characters immediately following the last of the expected numerical arguments, are irrelevant and are ignored.
It is a fatal error (LNK1118) not to provide the one or two expected numbers. If commit and reserve are both provided, it is a fatal error (LNK1229) if commit exceeds reserve.
A HEAPSIZE statement translates to a /heap option for the export-file command line. The general form is:
/HEAP:reserve[,commit]
where reserve and commit are expressed as decimals, and commit is omitted if it was not given in the definition.
LIB plainly provides for the syntax that gives commit without reserve, but the translation is to
/HEAP:
with no arguments, which is surely a coding error, since it would cause a fatal error (LNK1146) if given to LINK.