diff options
-rw-r--r-- | src/backend/storage/page/itemptr.c | 7 | ||||
-rw-r--r-- | src/include/storage/itemptr.h | 7 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/backend/storage/page/itemptr.c b/src/backend/storage/page/itemptr.c index c9918289691..244d8fba2f6 100644 --- a/src/backend/storage/page/itemptr.c +++ b/src/backend/storage/page/itemptr.c @@ -28,6 +28,13 @@ bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2) { + /* + * We really want ItemPointerData to be exactly 6 bytes. This is rather a + * random place to check, but there is no better place. + */ + StaticAssertStmt(sizeof(ItemPointerData) == 3 * sizeof(uint16), + "ItemPointerData struct is improperly padded"); + if (ItemPointerGetBlockNumber(pointer1) == ItemPointerGetBlockNumber(pointer2) && ItemPointerGetOffsetNumber(pointer1) == diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h index eb06c794d2b..60e76e9ffa0 100644 --- a/src/include/storage/itemptr.h +++ b/src/include/storage/itemptr.h @@ -39,9 +39,10 @@ typedef struct ItemPointerData BlockIdData ip_blkid; OffsetNumber ip_posid; } - -#ifdef __arm__ -pg_attribute_packed() /* Appropriate whack upside the head for ARM */ +/* If compiler understands packed and aligned pragmas, use those */ +#if defined(pg_attribute_packed) && defined(pg_attribute_aligned) +pg_attribute_packed() +pg_attribute_aligned(2) #endif ItemPointerData; |