PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
block.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BlockIdData
 

Macros

#define InvalidBlockNumber   ((BlockNumber) 0xFFFFFFFF)
 
#define MaxBlockNumber   ((BlockNumber) 0xFFFFFFFE)
 

Typedefs

typedef uint32 BlockNumber
 
typedef struct BlockIdData BlockIdData
 
typedef BlockIdDataBlockId
 

Functions

static bool BlockNumberIsValid (BlockNumber blockNumber)
 
static void BlockIdSet (BlockIdData *blockId, BlockNumber blockNumber)
 
static bool BlockIdEquals (const BlockIdData *blockId1, const BlockIdData *blockId2)
 
static BlockNumber BlockIdGetBlockNumber (const BlockIdData *blockId)
 

Macro Definition Documentation

◆ InvalidBlockNumber

#define InvalidBlockNumber   ((BlockNumber) 0xFFFFFFFF)

Definition at line 33 of file block.h.

◆ MaxBlockNumber

#define MaxBlockNumber   ((BlockNumber) 0xFFFFFFFE)

Definition at line 35 of file block.h.

Typedef Documentation

◆ BlockId

typedef BlockIdData* BlockId

Definition at line 59 of file block.h.

◆ BlockIdData

typedef struct BlockIdData BlockIdData

◆ BlockNumber

Definition at line 31 of file block.h.

Function Documentation

◆ BlockIdEquals()

static bool BlockIdEquals ( const BlockIdData blockId1,
const BlockIdData blockId2 
)
inlinestatic

Definition at line 92 of file block.h.

93 {
94  return (blockId1->bi_hi == blockId2->bi_hi &&
95  blockId1->bi_lo == blockId2->bi_lo);
96 }
uint16 bi_lo
Definition: block.h:56
uint16 bi_hi
Definition: block.h:55

References BlockIdData::bi_hi, and BlockIdData::bi_lo.

◆ BlockIdGetBlockNumber()

static BlockNumber BlockIdGetBlockNumber ( const BlockIdData blockId)
inlinestatic

Definition at line 103 of file block.h.

104 {
105  return (((BlockNumber) blockId->bi_hi) << 16) | ((BlockNumber) blockId->bi_lo);
106 }
uint32 BlockNumber
Definition: block.h:31

References BlockIdData::bi_hi, and BlockIdData::bi_lo.

Referenced by gin_desc(), ginRedoInsert(), and ItemPointerGetBlockNumberNoCheck().

◆ BlockIdSet()

static void BlockIdSet ( BlockIdData blockId,
BlockNumber  blockNumber 
)
inlinestatic

Definition at line 81 of file block.h.

82 {
83  blockId->bi_hi = blockNumber >> 16;
84  blockId->bi_lo = blockNumber & 0xffff;
85 }

References BlockIdData::bi_hi, and BlockIdData::bi_lo.

Referenced by ginPlaceToPage(), ItemPointerSet(), ItemPointerSetBlockNumber(), and ItemPointerSetInvalid().

◆ BlockNumberIsValid()