DIRECTORY ; GGStoragePools: CEDAR DEFINITIONS = BEGIN MakeStorageProc: TYPE = PROC [pool: StoragePool]; AllocateProc: TYPE = PROC [pool: StoragePool] RETURNS [item: REF ANY]; FreeProc: TYPE = PROC [pool: StoragePool, item: REF ANY]; StoragePoolClass: TYPE = REF StoragePoolClassObj; StoragePoolClassObj: TYPE = RECORD [ name: ATOM, allocate: AllocateProc, free: FreeProc ]; StoragePool: TYPE = REF StoragePoolObj; StoragePoolObj: TYPE = MONITORED RECORD [ class: StoragePoolClass, data: REF ANY ]; CreateClass: PROC [name: ATOM, allocate: AllocateProc, free: FreeProc] RETURNS [class: StoragePoolClass]; CreatePool: PROC [class: StoragePoolClass, makeStorage: MakeStorageProc] RETURNS [pool: StoragePool]; Allocate: PROC [pool: StoragePool] RETURNS [item: REF ANY]; Free: PROC [pool: StoragePool, item: REF ANY]; END. â GGStoragePools.mesa Contents: Routines for maintaining various storage pools and synchronizing their use. Synchronization is the main reason for the existence of this module. It provides a MONITOR lock for each storage pool. Copyright Ó 1988, 1992 by Xerox Corporation. All rights reserved. Bier, June 5, 1987 2:02:43 pm PDT allocate is called by Allocate. It returns one REF from the pool to the caller. allocate is also a good place to initialize fields in the REF. free is called by Free. It allows the caller to return one REF to the pool, when the caller is done with it. Creates a new pool and allows makeStorage to allocate some number of REFs to serve as the pool contents. calls pool.allocate. calls pool.free. Êá•NewlineDelimiter –(cedarcode) style™codešœ™KšÏnœ¤Ïkœ™ÏKšœ Ïeœ6™BKšœž™!K™—šž ˜ Kšœ˜—K˜Kšœžœž œ˜#Kšž˜K˜Kšœžœžœ˜1Kš œžœžœžœžœžœ˜GKš œ žœžœžœžœ˜9K˜Kšœžœžœ˜1šœžœžœ˜$Kšœžœ˜ K˜K˜K˜—K˜Kšœ žœžœ˜'šœžœžœ˜)K˜Kšœžœž˜ K˜K˜—š œžœžœ*žœ˜iKšœÿ™ÿK˜—š œžœ9žœ˜eKšœh™hK™—š œžœžœžœžœ˜;Kšœ™—šœžœžœžœ˜.Kšœ™—K˜Kšžœ˜K˜K˜—…—<ÿ