|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Modular unit of storage allocation.. A zone is a source of storage for objects or other allocated data. Whenever a new object is created, a zone must be identified from which the storage for its instance variables, or other internal data, is obtained. A program may establish multiple zones to ensure that objects with similar lifetime or storage needs are allocated together, and in general to optimize allocation and reuse of storage. Zones also maintain a collection of all objects allocated within the zone. This collection, referred to as the "population" of a zone, is a set of all objects which have been created but not yet dropped within the zone. Collections maintained automatically by zones can eliminate a need for other, separately maintained collections in applications that need to keep track of entire populations of objects. Collections of allocated objects can provide support for object query, external object storage, and automatic storage reclamation. A zone may be used to obtain storage not only for objects, but also for raw storage blocks like those provided by the C malloc function. All objects and storage blocks allocated in a zone remain local to that zone. This means that allocation of storage in other zones does not affect the efficiency of storage allocation within a particular zone. For most zone types, individual allocations may still be freed within a zone, and total storage of a zone may grow and shrink according to aggregate needs. In addition to freeing individual allocations, an entire zone may also dropped. Dropping a zone automatically frees all allocations made within it, including final drop processing on any allocated objects that need it. Release of an entire zone can be much faster than individual release of each object within it. The Zone type is a fully implemented type that provides default storage management support for objects and other allocated storage. It is also a supertype for other zones that implement alternative policies for use in specialized situations. A zone is created using standard create messages just like other objects. This means that a zone must identify another zone from which it obtains its storage. Storage is typically obtained from this other zone in large units called pages, which are then managed by the local zone to support internal allocations. The getZone message of the Drop type returns the zone which provides these base pages. Since a new zone always requires that an existing zone be identified, no new zones could be created unless there were some zones that already existed. Several such zones are predefined as part of the defobj library; see predefined zones for a summary.
Method Summary | |
Object |
allocIVars(Object aClass)
allocIVars: allocates the instance variable structure for a new object. |
Object |
allocIVarsComponent(Object aClass)
These messages allocate, copy, and free This message allocates the storage that holds the instance variables for an object. |
Object |
copyIVars(Object anObject)
copyIVars: creates copies an existing instance variable structure into a new allocation made within the local zone. |
Object |
copyIVarsComponent(Object anObject)
Like allocateIVarsComponent, except it copies the storage that holds the instances variables for an object. |
void |
describeForEach(Object outputCharStream)
Generate debug description for each member of the zone population. |
void |
describeForEachID(Object outputCharStream)
Generate debug id description for each member of the zone population. |
void |
freeIVars(Object anObject)
freeIVars: releases storage that was previously allocated to hold the instance variable structure of an object. |
void |
freeIVarsComponent(Object anObject)
Frees the instance variable storage for an object. |
Object |
getComponentZone()
Returns a specially qualified version of the zone that automatically allocates all its objects with the internal component qualification, even if allocated with allocIVars: or copyIVars:. |
long |
getPageSize()
|
Object |
getPopulation()
getPopulation returns a collection all objects allocated in a zone using either allocIVars: or copyIVars: and not yet freed using freeIVars:. |
Object |
getReclaimPolicy()
|
boolean |
getStackedSubzones()
|
Methods inherited from interface swarm.defobj.Drop |
drop |
Methods inherited from interface swarm.defobj.DefinedObject |
compare,
describe,
describeID,
getDisplayName,
getTypeName,
getZone,
perform,
perform$with,
perform$with$with,
perform$with$with$with,
respondsTo,
setDisplayName,
xfprint,
xfprintid,
xprint,
xprintid |
Method Detail |
public Object getReclaimPolicy()
public boolean getStackedSubzones()
public long getPageSize()
public Object allocIVars(Object aClass)
public Object copyIVars(Object anObject)
public void freeIVars(Object anObject)
public Object allocIVarsComponent(Object aClass)
public Object copyIVarsComponent(Object anObject)
public void freeIVarsComponent(Object anObject)
public Object getComponentZone()
public Object getPopulation()
public void describeForEach(Object outputCharStream)
public void describeForEachID(Object outputCharStream)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |