DIRECTORY PrincOps USING [wordsPerPage], VM USING [Interval, LogPageCount, PageCount, PageNumber, VMPartition, AddressForPageNumber]; CountedVM: CEDAR DEFINITIONS IMPORTS VM ~ BEGIN Handle: TYPE ~ REF Object; Object: TYPE ~ RECORD [interval: VM.Interval]; Allocate: PROCEDURE [words: INT, partition: VM.VMPartition _ normalVM, subRange: VM.Interval _ [0, 0], start: VM.PageNumber _ 0, alignment: VM.LogPageCount _ 0, in64K: BOOL _ FALSE] RETURNS [Handle]; Pointer: UNSAFE PROCEDURE [handle: Handle] RETURNS [LONG POINTER] ~ UNCHECKED INLINE {RETURN [VM.AddressForPageNumber[handle.interval.page]]}; Words: PROCEDURE [handle: Handle] RETURNS [INT] ~ INLINE {RETURN [handle.interval.count*PrincOps.wordsPerPage]}; END. :CountedVM.mesa Michael Plass, January 20, 1984 1:13:44 pm PST Allocates the requested number of words of virtual memory, rounded up to a whole number of pages (the other arguments are passed unchanged to VM.Allocate and should ordinarily be defaulted). Returns a Handle designating the VM that was allocated. The client is responsible for holding onto the Handle for at least as long as it wants to be able to use the VM. The best way to reclaim the VM is to drop all copies of the handle and invoke the garbage collector. Exceptions: raises VM.CantAllocate under the conditions described in the VM interface. Returns a pointer to the first word of the allocated storage. The client is responsible for making sure the resulting pointer is not used after the handle is dropped. Returns the number of words allocated. ΚP– "Cedar" style˜Jšœ™J™.šΟk ˜ Jšœ œ˜JšœœT˜\J˜—š œ œ œœœ˜/J˜Jšœœœ˜šœœœ œ ˜.J˜—šΟnœ œ œ œ#œœœœœœ ˜ΗJšœΟ™ΟJ™VJ˜—š žœœ œœœœ˜AJš œ œœœœ.˜LJšœ§™§J˜—šžœ œœœ˜/Jšœœœ0˜@Jšœ&™&J˜—Jšœ˜——…—Τ^