DIRECTORY Environment USING [wordsPerPage], MBStorage USING [], Space USING [ Create, Delete, GetHandle, Handle, LongPointer, Map, mds, PageFromLongPointer, Pointer, virtualMemory]; MBStorageImpl: PROGRAM IMPORTS Space EXPORTS MBStorage = BEGIN Pages: PUBLIC PROC [npages: CARDINAL] RETURNS [base: LONG POINTER] = { space: Space.Handle = Space.Create[npages, Space.virtualMemory]; Space.Map[space]; RETURN[Space.LongPointer[space]] }; MDSPages: PUBLIC PROC [npages: CARDINAL] RETURNS [base: POINTER] = { space: Space.Handle = Space.Create[npages, Space.mds]; Space.Map[space]; RETURN[Space.Pointer[space]] }; Words: PUBLIC PROC [nwords: CARDINAL] RETURNS [base: LONG POINTER] = {RETURN[Pages[PagesForWords[nwords]]]}; MDSWords: PUBLIC PROC [nwords: CARDINAL] RETURNS [base: LONG POINTER] = {RETURN[MDSPages[PagesForWords[nwords]]]}; FreePages: PUBLIC PROC [base: LONG POINTER] = {IF base ~= NIL THEN Space.Delete[Space.GetHandle[Space.PageFromLongPointer[base]]]}; FreeMDSPages: PUBLIC PROC [base: POINTER] = {FreePages[LONG[base]]}; FreeWords: PUBLIC PROC [base: LONG POINTER] = {FreePages[base]}; FreeMDSWords: PUBLIC PROC [base: POINTER] = {FreeMDSPages[base]}; PagesForWords: PUBLIC PROC [nWords: CARDINAL] RETURNS [CARDINAL] = {RETURN[(nWords + Environment.wordsPerPage - 1)/Environment.wordsPerPage]}; END. FMBStorageImpl.mesa Edited by Levin on April 5, 1983 3:44 pm ʘJšœ™Jšœ(™(J˜šÏk ˜ Jšœ œ˜!Jšœ œ˜šœœ˜ J˜gJ˜——šœ˜šœ˜ Jšœ ˜—J˜—Jš˜J˜šÏnœœœ œœœœ˜FJ˜@J˜Jšœ˜ Jšœ˜J˜—š žœœœ œœœ˜DJ˜6J˜Jšœ˜Jšœ˜J˜—šžœœœ œœœœ˜DJšœœ ˜'J˜—šžœœœ œœœœ˜GJšœœ#˜*J˜—š ž œœœœœ˜-Jšœœ œœA˜UJ˜—Jš ž œœœœœ ˜DJ˜Jš ž œœœœœ˜@J˜Jšž œœœœ˜AJ˜š ž œœœ œœœ˜BJšœœD˜KJ˜—Jšœ˜J˜—…—0†