7.5 The Store structure

alloc_policy

Datatype

Specification:
datatype alloc_policy =
ORIGIN | SUCC | ALIGNED_4 | ALIGNED_8

Description:

A store object is created just like any other ML value (except that it is static, that is, the garbage collector may not relocate it) and given some memory for its representation.

However, a store is involved in managing a number of obj objects associated with its workspace area. The alloc_policy datatype is used to specify the manner in which space is given to these obj objects from within the store's workspace:

ORIGIN
Newly created objects are initially located at the origin. Once created, such objects may be moved around with their host store by using relocation operations. In this way, you have control of the arrangement of objects within the store.

Object relocation operations are obviously sensitive to the underlying data model of the foreign language, and so are implemented by the language-specific component of the FI.

SUCC
Each fresh object is located at the 'top' of the workspace, immediately following all the other objects.

ALIGNED_4
As for SUCC, but each fresh object is allocated on a 4-byte address boundary (that is, the address is 0 mod 4).

ALIGNED_8
As for SUCC, but each fresh object is allocated on a 8-byte address boundary (that is, the address is 0 mod 8).

It is possible to have several stores in use at the same time. Each could have different allocation policies, in order to handle different kinds of data.


MLWorks Reference Manual (version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker