7.5 The Store structure

overflow_policy

Datatype

Specification:
datatype overflow_policy =
BREAK | EXTEND | RECYCLE

Description:

Each store object in effect manages a piece of workspace memory on ML's behalf, and objects are associated with parts of this workspace. A store is said to have overflowed when an attempt is made to use more space than is presently available in the associated workspace. When overflow occurs, an overflow policy is enacted. The overflow_policy datatype provides a number of possibilities when overflow occurs:

BREAK
The exception ExpandStore is raised upon an attempt to expand the store (possibly made with the expand function, described on page 212). A store with this overflow policy is effectively fixed in size because it cannot be expanded.

EXTEND
The store automatically expands, by amount determined by an internal rule, to accommodate further allocation requests. This expansion is obviously subject to system limits on the amount of memory that a process can have mapped at a time.

Explicit calls to expand (see page 212) need advice on how much extra space should be allocated.

In effect, stores with this overflow policy are flexible in size and can be expanded as necessary by automatic or manual methods.

RECYCLE
Allocation resumes at the origin of the store, overwriting any data presently at the origin. This policy is suitable for stores containing ephemeral objects, that is, objects whose lifetimes are known in advance to be short.

There is clearly a danger that live data can be overwritten in a store using this policy.

Stores with this overflow policy may be explicitly expanded. If a request to allocate more space cannot be satisfied for some reason, the ExpandStore exception is raised.


MLWorks Reference Manual (version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker