previous next top contents index framed top this page unframed
Figure 32–43. $collectLock
| # system variable INTEGER $collectLock; |
No automatic collection occurs if $collectLock is non-zero. Customarily, $collectLock is incremented by one before a section of code in which collections are not to occur, then decremented by one afterwards. Assignment of a specific value to $collectLock without saving the previous value is undefined, since $collectLock may have a non-zero value even in ordinary user code.
If the programmer is not careful to redecrement $collectLock, collections may be locked out indefinitely, which may cause the MAINSAIL execution to run out of memory.
In most cases, it is better to use the PROCEDURE $memoryManagementInfo (see Section 41.9) than $collectLock, because $memoryManagementInfo does not lock out collections entirely, and therefore cannot cause MAINSAIL to run out of memory.
MAINSAIL Language Manual, Section 32.42