Type abbreviation
type store
Datatype
datatype store_status = LOCKED_STATUS | RD_STATUS | WR_STATUS | RDWR_STATUS
LOCKED_STATUSStore data may not be accessed or modified by ML.
RD_STATUSStore data is read-only from ML.
WR_STATUSStore data is write-only from ML.
RDWR_STATUSStore data is readable/writeable from ML (the default).
Exception
exception ReadOnly
LOCKED_STATUS or RD_STATUS.
Exception
exception WriteOnly
LOCKED_STATUS or WR_STATUS.
Function
val storeStatus : store -> store_status
Function
val setStoreStatus :
(store * store_status) -> unit
Datatype
datatype alloc_policy =
ORIGIN | SUCC | ALIGNED_4 | ALIGNED_8
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:
ORIGINNewly 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.
SUCCEach 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).
Datatype
datatype overflow_policy =
BREAK | EXTEND | RECYCLE
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 236). 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.
expand (see page 236) need advice on how much extra space should be allocated.
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.
ExpandStore exception is raised.
Function
val store :
{ alloc : alloc_policy,
overflow : overflow_policy,
status : store_status,
size : int
} -> store
store_status may be modified using the setStoreStatus function (see page 232), and the store's size may be explicitly increased (when possible) using the expand function (see page 236). The other store attributes cannot be modified dynamically.
Function
val storeSize : store -> int
Function
val storeAlloc : store -> alloc_policy
Function
val storeOverflow : store -> overflow_policy
Function
val isStandardStore : store -> bool
ORIGIN or if the overflow policy is not RECYCLE.
Function
val isEphemeralStore : store -> bool
ORIGIN and the overflow policy is RECYCLE.
Exception
exception ExpandStore
Function