PostgreSQL Source Code git master
multixact_internal.h File Reference
#include "access/multixact.h"
Include dependency graph for multixact_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MULTIXACT_OFFSETS_PER_PAGE   (BLCKSZ / sizeof(MultiXactOffset))
 
#define MXACT_MEMBER_BITS_PER_XACT   8
 
#define MXACT_MEMBER_FLAGS_PER_BYTE   1
 
#define MXACT_MEMBER_XACT_BITMASK   ((1 << MXACT_MEMBER_BITS_PER_XACT) - 1)
 
#define MULTIXACT_FLAGBYTES_PER_GROUP   4
 
#define MULTIXACT_MEMBERS_PER_MEMBERGROUP    (MULTIXACT_FLAGBYTES_PER_GROUP * MXACT_MEMBER_FLAGS_PER_BYTE)
 
#define MULTIXACT_MEMBERGROUP_SIZE    (sizeof(TransactionId) * MULTIXACT_MEMBERS_PER_MEMBERGROUP + MULTIXACT_FLAGBYTES_PER_GROUP)
 
#define MULTIXACT_MEMBERGROUPS_PER_PAGE   (BLCKSZ / MULTIXACT_MEMBERGROUP_SIZE)
 
#define MULTIXACT_MEMBERS_PER_PAGE    (MULTIXACT_MEMBERGROUPS_PER_PAGE * MULTIXACT_MEMBERS_PER_MEMBERGROUP)
 

Functions

static int64 MultiXactIdToOffsetPage (MultiXactId multi)
 
static int MultiXactIdToOffsetEntry (MultiXactId multi)
 
static int64 MultiXactIdToOffsetSegment (MultiXactId multi)
 
static int64 MXOffsetToMemberPage (MultiXactOffset offset)
 
static int64 MXOffsetToMemberSegment (MultiXactOffset offset)
 
static int MXOffsetToFlagsOffset (MultiXactOffset offset)
 
static int MXOffsetToFlagsBitShift (MultiXactOffset offset)
 
static int MXOffsetToMemberOffset (MultiXactOffset offset)
 

Macro Definition Documentation

◆ MULTIXACT_FLAGBYTES_PER_GROUP

#define MULTIXACT_FLAGBYTES_PER_GROUP   4

Definition at line 70 of file multixact_internal.h.

◆ MULTIXACT_MEMBERGROUP_SIZE

#define MULTIXACT_MEMBERGROUP_SIZE    (sizeof(TransactionId) * MULTIXACT_MEMBERS_PER_MEMBERGROUP + MULTIXACT_FLAGBYTES_PER_GROUP)

Definition at line 74 of file multixact_internal.h.

◆ MULTIXACT_MEMBERGROUPS_PER_PAGE

#define MULTIXACT_MEMBERGROUPS_PER_PAGE   (BLCKSZ / MULTIXACT_MEMBERGROUP_SIZE)

Definition at line 76 of file multixact_internal.h.

◆ MULTIXACT_MEMBERS_PER_MEMBERGROUP

#define MULTIXACT_MEMBERS_PER_MEMBERGROUP    (MULTIXACT_FLAGBYTES_PER_GROUP * MXACT_MEMBER_FLAGS_PER_BYTE)

Definition at line 71 of file multixact_internal.h.

◆ MULTIXACT_MEMBERS_PER_PAGE

#define MULTIXACT_MEMBERS_PER_PAGE    (MULTIXACT_MEMBERGROUPS_PER_PAGE * MULTIXACT_MEMBERS_PER_MEMBERGROUP)

Definition at line 77 of file multixact_internal.h.

◆ MULTIXACT_OFFSETS_PER_PAGE

#define MULTIXACT_OFFSETS_PER_PAGE   (BLCKSZ / sizeof(MultiXactOffset))

Definition at line 32 of file multixact_internal.h.

◆ MXACT_MEMBER_BITS_PER_XACT

#define MXACT_MEMBER_BITS_PER_XACT   8

Definition at line 65 of file multixact_internal.h.

◆ MXACT_MEMBER_FLAGS_PER_BYTE

#define MXACT_MEMBER_FLAGS_PER_BYTE   1

Definition at line 66 of file multixact_internal.h.

◆ MXACT_MEMBER_XACT_BITMASK

#define MXACT_MEMBER_XACT_BITMASK   ((1 << MXACT_MEMBER_BITS_PER_XACT) - 1)

Definition at line 67 of file multixact_internal.h.

Function Documentation

◆ MultiXactIdToOffsetEntry()

static int MultiXactIdToOffsetEntry ( MultiXactId  multi)
inlinestatic

Definition at line 41 of file multixact_internal.h.

42{
43 return multi % MULTIXACT_OFFSETS_PER_PAGE;
44}
#define MULTIXACT_OFFSETS_PER_PAGE

References MULTIXACT_OFFSETS_PER_PAGE.

◆ MultiXactIdToOffsetPage()

static int64 MultiXactIdToOffsetPage ( MultiXactId  multi)
inlinestatic

Definition at line 35 of file multixact_internal.h.

36{
37 return multi / MULTIXACT_OFFSETS_PER_PAGE;
38}

References MULTIXACT_OFFSETS_PER_PAGE.

Referenced by MultiXactIdToOffsetSegment().

◆ MultiXactIdToOffsetSegment()

static int64 MultiXactIdToOffsetSegment ( MultiXactId  multi)
inlinestatic

Definition at line 47 of file multixact_internal.h.

48{
50}
static int64 MultiXactIdToOffsetPage(MultiXactId multi)
#define SLRU_PAGES_PER_SEGMENT

References MultiXactIdToOffsetPage(), and SLRU_PAGES_PER_SEGMENT.

Referenced by multixact_redo(), and TruncateMultiXact().

◆ MXOffsetToFlagsBitShift()

static int MXOffsetToFlagsBitShift ( MultiXactOffset  offset)
inlinestatic

Definition at line 105 of file multixact_internal.h.

106{
107 int member_in_group = offset % MULTIXACT_MEMBERS_PER_MEMBERGROUP;
108 int bshift = member_in_group * MXACT_MEMBER_BITS_PER_XACT;
109
110 return bshift;
111}
#define MXACT_MEMBER_BITS_PER_XACT
#define MULTIXACT_MEMBERS_PER_MEMBERGROUP

References MULTIXACT_MEMBERS_PER_MEMBERGROUP, and MXACT_MEMBER_BITS_PER_XACT.

◆ MXOffsetToFlagsOffset()

static int MXOffsetToFlagsOffset ( MultiXactOffset  offset)
inlinestatic

Definition at line 95 of file multixact_internal.h.

96{
98 int grouponpg = group % MULTIXACT_MEMBERGROUPS_PER_PAGE;
99 int byteoff = grouponpg * MULTIXACT_MEMBERGROUP_SIZE;
100
101 return byteoff;
102}
uint64 MultiXactOffset
Definition: c.h:683
#define MULTIXACT_MEMBERGROUPS_PER_PAGE
#define MULTIXACT_MEMBERGROUP_SIZE

References MULTIXACT_MEMBERGROUP_SIZE, MULTIXACT_MEMBERGROUPS_PER_PAGE, and MULTIXACT_MEMBERS_PER_MEMBERGROUP.

Referenced by MXOffsetToMemberOffset().

◆ MXOffsetToMemberOffset()

static int MXOffsetToMemberOffset ( MultiXactOffset  offset)
inlinestatic

Definition at line 115 of file multixact_internal.h.

116{
117 int member_in_group = offset % MULTIXACT_MEMBERS_PER_MEMBERGROUP;
118
119 return MXOffsetToFlagsOffset(offset) +
121 member_in_group * sizeof(TransactionId);
122}
uint32 TransactionId
Definition: c.h:671
#define MULTIXACT_FLAGBYTES_PER_GROUP
static int MXOffsetToFlagsOffset(MultiXactOffset offset)

References MULTIXACT_FLAGBYTES_PER_GROUP, MULTIXACT_MEMBERS_PER_MEMBERGROUP, and MXOffsetToFlagsOffset().

◆ MXOffsetToMemberPage()

static int64 MXOffsetToMemberPage ( MultiXactOffset  offset)
inlinestatic

Definition at line 82 of file multixact_internal.h.

83{
84 return offset / MULTIXACT_MEMBERS_PER_PAGE;
85}
#define MULTIXACT_MEMBERS_PER_PAGE

References MULTIXACT_MEMBERS_PER_PAGE.

Referenced by MXOffsetToMemberSegment().

◆ MXOffsetToMemberSegment()

static int64 MXOffsetToMemberSegment ( MultiXactOffset  offset)
inlinestatic

Definition at line 88 of file multixact_internal.h.

89{
91}
static int64 MXOffsetToMemberPage(MultiXactOffset offset)

References MXOffsetToMemberPage(), and SLRU_PAGES_PER_SEGMENT.

Referenced by multixact_redo(), and TruncateMultiXact().