LINK Help (linkx.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
/CPARM Option
                                             Up Contents Index Back
─────/CPARM Option──────────────────────────────────────────────────────────
 
     Syntax:  /CP[ARMAXALLOC]:number
 
     This option sets the maximum number of 16-byte paragraphs needed
     by the program when it is loaded into memory. Specify the number
     of paragraphs as an integer from 1 to 65,535. This option is valid
     only when linking DOS programs.
     See: Entering Numeric Arguments
 
     If <number> is less than the minimum number of paragraphs needed
     by the program, LINK ignores your request and sets the maximum
     value equal to whatever the minimum value happens to be. The
     minimum number of paragraphs needed by a program is never less
     than the number of paragraphs of code and data in the program.
 
     The operating system uses this value to allocate space for the
     program before loading it. /CPARM is useful when you want to
     execute another program from within your program and you need to
     reserve memory for it.
 
     Without this option, LINK sets the request to 65,535 paragraphs.
     This request exceeds DOS limits and always fails; the operating
     system then allocates the largest contiguous block of memory. If
     the /CPARM option is used, the operating system allocates no more
     space than the option specified. Any memory in excess of that
     required for the program loaded is free for other programs.
 
     To free more memory for programs compiled in the medium and
     large memory models, link with /CPARM:1. This leaves no space for
     the near heap.
 
     NOTE: You can use the EXEHDR utility to change the maximum
           allocation space after a program has been linked.
           See: What Is EXEHDR? (in Miscellaneous Utilities Help)
                                    -♦-