-- File DBSegmentPrivate.mesa -- Last edited by: -- MBrown on December 16, 1982 3:08 pm -- Cattell on July 16, 1982 10:42 am DIRECTORY DBCommon USING [DBPage, NullDBPage, softwareCompatibilityVersion], DBStoragePagetags USING[Free, AMap], DBStorageTID USING[TID]; DBSegmentPrivate: DEFINITIONS = BEGIN DBPage: TYPE = DBCommon.DBPage; NullDBPage: DBPage = DBCommon.NullDBPage; TID: TYPE = DBStorageTID.TID; StrBody: TYPE = MACHINE DEPENDENT RECORD [ length: CARDINAL ← 0, maxLength: CARDINAL ← StrMaxLength, text: PACKED ARRAY [0..StrMaxLength) OF CHAR ← TRASH]; StrMaxLength: CARDINAL = 64; -- If I could write StringBody[StrMaxLength], or even TEXT[StrMaxLength], I would! -- Definition of persistent segment-related objects -- The record types below are necessarily MACHINE DEPENDENT since their --representation must not change with different versions of the compiler (because --instances of these types will persist in the database). SegmentHeadPage: TYPE = MACHINE DEPENDENT RECORD[ tag: [0..377B] ← DBStoragePagetags.AMap, -- Page type, on all pages in the system. unused: [0..377B] ← 0, -- On tuple pages, the count of allocated slots on the page. softwareCompatibilityVersion: CARDINAL ← DBCommon.softwareCompatibilityVersion, -- Version of DB software that initially produced this segment. seal: LONG CARDINAL ← Seal, name: StrBody ← [], segmentID: DBPage, -- Address of this page in DB. allocator: RECORD [ firstPageInBlock: DBPage, -- Pointer to first in a block of consecutive free pages in this segment, or NullDBPage --to indicate no block. nPagesInBlock: CARDINAL, -- Count of number of pages in block. pagesPerExtent: CARDINAL, -- Number of pages to allocate from end of file when page allocator is empty. freeList: DBPage ← NullDBPage -- Pointer to first in a list of free pages in this segment, or NullDBPage to --indicate no list. Format of FreeListPages is defined below. ], index1: TID ← TRASH, index2: TID ← TRASH ]; Seal: LONG CARDINAL = 16177213452B; --exp(gamma) -- Format of a page on a segment free list. FreeListPage: TYPE = MACHINE DEPENDENT RECORD[ tag: [0..377B] ← DBStoragePagetags.Free, -- Page type (DBStoragePagetags). unused: [0..377B] ← 0, next: DBCommon.DBPage, -- Pointer to next in a list of free pages in this segment, or NullDBPage. nPagesInBlock: CARDINAL ← 1 -- Number of consecutive free pages that this page represents. ];--FreeListPage END.--DBSegmentPrivate CHANGE LOG Created by MBrown on June 2, 1980 9:37 AM -- By splitting defs out of SegmentImpl.mesa Changed by MBrown on June 10, 1980 9:02 PM -- TID is now from DBStorageTID. Changed by MBrown on August 22, 1980 11:35 AM -- Made NCachePages = 512. Changed by MBrown on December 8, 1980 1:57 PM -- Changed AMapPage to allow segment page allocator to represent a block of pages (expected to --be the end of a file that we're extending), and extended free list format to allow blocks --to be represented there, too. Changed by MBrown on February 26, 1981 9:35 PM -- Use DBFile.File, not UserPineDefs.File. InlineDefs -> Inline. Changed by Cattell on May 24, 1982 9:48 am -- Make FileHandle into REF. Default value of FileHandle is NIL in InternalQuantumObject.