File DBSegmentPrivate.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by:
MBrown on December 16, 1982 3:08 pm
Cattell on July 16, 1982 10:42 am
Willie-Sue, September 17, 1986 10:33:47 am PDT
Donahue, May 22, 1986 11:11:53 am PDT
DIRECTORY
DBCommon USING [DBPage, NullDBPage, softwareCompatibilityVersion, systemIndexCount, TID],
DBStoragePage USING[Free, AMap];
DBSegmentPrivate: CEDAR DEFINITIONS
= BEGIN
DBPage: TYPE = DBCommon.DBPage;
NullDBPage: DBPage = DBCommon.NullDBPage;
TID: TYPE = DBCommon.TID;
StrBody: TYPE = MACHINE DEPENDENT RECORD [
length: CARDINAL ← 0, maxLength: CARDINAL ← StrMaxLength,
text: PACKED ARRAY [0..StrMaxLength) OF CHARTRASH];
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] ← DBStoragePage.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.
],
schemaVersionStamp: INTTRASH,
schema version stamp for this segment
systemIndices: ARRAY [0..DBCommon.systemIndexCount) OF TID
the collection of system indices
];
Seal: LONG CARDINAL = 16177213452B; --exp(gamma)
Format of a page on a segment free list.
FreeListPage: TYPE = MACHINE DEPENDENT RECORD[
tag: [0..377B] ← DBStoragePage.Free,
Page type (DBStoragePage).
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