.KEEP - keep memory used by ".bset".

Description:

When a B program starts up, it uses ".bset" to parse the command line (see "expl b lib .bset") and create the "argv" and "argc" arguments for "main". The start-up routine then checks to see if the program has defined ".keep". If ".keep" has not been declared, or if it has been initialized to the integer zero, the start-up routine frees all the memory used by ".bset" (including the executable code); this memory is then available for use by dynamic memory allocation. If ".keep" has been declared and initialized to a non-zero value, ".bset" is not freed.

If you intend to use ".bset" explicitly in your program (i.e. after program start-up), you must declare ".keep" and give it a non-zero value.

Using ".keep" properly is especially important in overlaid programs. If you are using an overlaid program, and you force ".bset" out of the root overlay into an overlaid area, then you must also set ".keep" to a non-zero value. If you neglect to do this, the dynamic memory chain will be corrupted when the overlay containing ".bset" is overlaid.

See Also:

expl b lib .bset

Copyright © 1996, Thinkage Ltd.