summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2016-09-22 18:30:33 +0000
committerTom Lane2016-09-22 18:30:33 +0000
commit8023b5827fbada6815ce269db4f3373ac77ec7c3 (patch)
tree23d92d4b750de0095e609ef8e75280a4c1536e66
parent96dd77d349424f270d129f8f40e75f762ddcca7d (diff)
Remove nearly-unused SizeOfIptrData macro.
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>
-rw-r--r--src/backend/executor/nodeTidscan.c2
-rw-r--r--src/include/storage/itemptr.h8
2 files changed, 3 insertions, 7 deletions
diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c
index 2604103352..d54fe3665f 100644
--- a/src/backend/executor/nodeTidscan.c
+++ b/src/backend/executor/nodeTidscan.c
@@ -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)
{
diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h
index 7ec7ed30c9..0deab7a859 100644
--- a/src/include/storage/itemptr.h
+++ b/src/include/storage/itemptr.h
@@ -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;
/* ----------------