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, February 15, 1985 11:09:36 am PST
Donahue, November 13, 1985 6:13:50 pm PST
DIRECTORY
DBCommon USING [DBPage, NullDBPage, softwareCompatibilityVersion, systemIndexCount],
DBStoragePagetags USING[Free, AMap],
DBStorageTID USING[TID];
DBSegmentPrivate: CEDAR 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 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] ← 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.
],
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] ← 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