C Language and Libraries Help (clang.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.
_vheapinit
 Summary Example                         Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The _vheapinit routine initializes the virtual memory manager in
     preparation for future allocations. It must be called before any
     virtual memory blocks are requested.
 
     The <dosmin> argument represents the minimum amount of DOS memory
     that must be available for the virtual memory manager to install
     itself, in paragraphs. The _vheapinit function may round up the
     minimum value specified. If, after rounding, the minimum amount
     of DOS memory is not available, _vheapinit does not initialize
     the virtual memory manager and returns 0. The virtual memory
     manager requires several kilobytes to function effectively.
 
     The <dosmax> argument represents the maximum amount of DOS memory
     that the virtual memory manager can use, in paragraphs. If
     _VM_ALLDOS is specified for the <dosmax> argument, the virtual
     memory manager uses all available DOS memory.
 
     The <swaparea> argument specifies which types of auxiliary memory
     the virtual memory manager can use to hold blocks of memory that
     are swapped out. The argument can be one or more of the following
     manifest constants, combined with the bitwise-OR operator (|):
 
     Value          Meaning
 
     _VM_EMS        Use expanded memory
     _VM_XMS        Use extended memory
     _VM_DISK       Use disk space
     _VM_ALLSWAP    ( _VM_EMS | _VM_XMS | _VM_DISK )
 
     If not all of the specified forms of storage are available, the
     virtual memory manager uses what is available.
 
     After the program is done using virtual memory, it must call
     _vheapterm to terminate the virtual memory manager. A program can
     contain multiple pairs of _vheapinit/_vheapterm calls.
 
     WARNING: If the program terminates without a call to _vheapterm,
              various system memory resources may not be available to
              subsequent programs.
 
     To specify that no minimum amount of memory is required for
     installation of the virtual memory manager and to use all available
     DOS memory in the virtual heap and all auxiliary storage, use the
     following command:
 
          if( _vheapinit( 0, _VM_ALLDOS, _VM_ALLSWAP) == 0 )
             /* Error */
 
     Return Value
 
     The _vheapinit function returns a nonzero value if the virtual
     memory manager was successfully initialized. Otherwise, it returns
     zero.
                                    -♦-