13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Loading of Program Unit SegmentsNormally, all segments of program Units used by a program are loadedautomatically before the program begins executing, and remain in memorythroughout program execution. For example, consider the followingprogram where DELTA and GAMMA are two units, either Regular orIntrinsic:PROGRAM TWOUSES DELTA, GAMMA;BEGINEND.Throughout program execution, the segments in memory are TWO, DELTA,and GAMMA. The loading of Program Unit segments can be controlled bythe "no load" and "resident" Compiler options, as explained below.In any case, the initialization section of every Intrinsic Unit is executed atprogram startup time. The order in which unit names are listed in the USESstatement at the beginning of the program is significant; the initializationcode for the units is executed in this order.The "No Load" Compiler OptionThe "no load" Compiler option has the formUH+>The option is placed at the beginning of the main program body (after theBEGIN). It causes all unit segments to be swapped in and out in the sameway as SEGMENT procedures: thus a unit segment is in memory only whena procedure or function in its INTERFACE is referenced by the program.The "no load" option does not prevent the initialization section of a unitfrom being loaded and executed before program execution; but afterinitialization, the unit segment is unloaded until it is activated. Theinitialization code is not executed when the unit is reloaded.Consider the following program, where HUGEPROC is a large SEGMENTprocedure and BIG UNIT is a large unit. The system does not have enoughmemory to hold HUGEPROC and BIG UNIT at the same time, along with theprogram itself.III-254Chapter 15: Large Program Management

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!