C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Large Memory Model: Details
                                             Up Contents Index Back
─────C/C++ Compiler─────────────────────────────────────────────────────────
 
     Syntax:  /AL
 
     The large-model option allows multiple segments for both code and
     data, as needed. No individual data item can exceed 64K.
 
     This memory model is useful for large programs that require a
     large amount of data storage.
 
     The defaults in large-model programs are far code addressing and
     far data addressing. You can override the defaults with the __near
     keyword for code and the __near or __huge keyword for data.
 
     To maximize efficiency, the compiler tries to allocate static and
     initialized global data in DGROUP. The compiler allocates data
     items larger in size than the data-size threshold (set with /Gt) in
     segments outside of DGROUP. The sum of all the items smaller than
     the threshold must be less than 64K.
     See: Data Size Threshold (/Gt)
 
     Under the compact, large, or huge memory model, the compiler
     allocates initialized data items as near if they are smaller than
     or equal in size to the threshold value set by the /Gt option. The
     /Gx option extends this initialized data allocation rule to data
     that is uninitialized and data that is marked as extern. Near
     data offers two benefits:
 
        ■ The compiler can generate more efficient code to reference
          data it knows is near.
 
        ■ You can achieve multiple instances of a single windows
          application when all data is near.
 
     See: Overriding Default Addressing
          Assume That Data Is Near Option (/Gx)
 
     Using the /AL option causes CL to emit both the _M_I86 and the
     _M_I86LM preprocessor identifiers.
                                    -♦-