Remove nearly-unused SizeOfIptrData macro.
authorTom Lane <[email protected]>
Thu, 22 Sep 2016 18:30:33 +0000 (14:30 -0400)
committerTom Lane <[email protected]>
Thu, 22 Sep 2016 18:30:33 +0000 (14:30 -0400)
Past refactorings have removed all but one reference to SizeOfIptrData
(and that one place was in a pretty noncritical spot).  Since nobody's
complained, it seems probable that there are no supported compilers
that don't think sizeof(ItemPointerData) is 6.  If there are, we're
wasting MAXALIGN per heap tuple anyway, so it's rather silly to worry
about whether we can shave space in places like WAL records.

Pavan Deolasee

Discussion: <CABOikdOOawDda4hwLOT6zdA6MFfPLu3Z2YBZkX0JdayNS6JOeQ@mail.gmail.com>

src/backend/executor/nodeTidscan.c
src/include/storage/itemptr.h

index 2604103352949ff9c96860a0f3872255264091d6..d54fe3665f7640e06864d4cc37255cc135216474 100644 (file)
@@ -139,7 +139,7 @@ TidListCreate(TidScanState *tidstate)
                continue;
            itemarray = DatumGetArrayTypeP(arraydatum);
            deconstruct_array(itemarray,
-                             TIDOID, SizeOfIptrData, false, 's',
+                             TIDOID, sizeof(ItemPointerData), false, 's',
                              &ipdatums, &ipnulls, &ndatums);
            if (numTids + ndatums > numAllocTids)
            {
index 7ec7ed30c97c03726e9ba4fb4715526699cdaa35..0deab7a859f406c3542e6213d45878618f06cde1 100644 (file)
@@ -30,9 +30,8 @@
  * structure padding bytes.  The struct is designed to be six bytes long
  * (it contains three int16 fields) but a few compilers will pad it to
  * eight bytes unless coerced.  We apply appropriate persuasion where
- * possible, and to cope with unpersuadable compilers, we try to use
- * "SizeOfIptrData" rather than "sizeof(ItemPointerData)" when computing
- * on-disk sizes.
+ * possible.  If your compiler can't be made to play along, you'll waste
+ * lots of space.
  */
 typedef struct ItemPointerData
 {
@@ -46,9 +45,6 @@ pg_attribute_aligned(2)
 #endif
 ItemPointerData;
 
-#define SizeOfIptrData \
-   (offsetof(ItemPointerData, ip_posid) + sizeof(OffsetNumber))
-
 typedef ItemPointerData *ItemPointer;
 
 /* ----------------