Class logrecord declares a buffer which is an array of
characters of size . PAGESIZE, the size of
a page, is declared in the header file page.h. A normal update
can log a modification to an entire page of the database. Thus, the
sizes of the before and after images can each be one page. Header
information in each log record will add another fraction of a page.
Thus, a maximum size of 3 pages suffices. Checkpoint records,
however, could potentially be very large. In such situations, the log
record can be broken into several pieces, each piece of size less than
3 pages.
The first part of the buffer contains the log record header (described in Section 4.2). The remaining portion is the data. Thus, the entire log record will be stored physically contiguously in the buffer. The logrechead_ptr and data_ptr members point to the start of the buffer and start + sizeof(logrecheader) respectively.
Implementation of the methods of this class also (see logrecord.h and logrecord.C) is straightforward and will not be described.