Re: Use of SizeOfIptrData - is that obsolete? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Use of SizeOfIptrData - is that obsolete?
Date
Msg-id 8044.1474569299@sss.pgh.pa.us
Whole thread Raw
In response to Re: Use of SizeOfIptrData - is that obsolete?  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Responses Re: Use of SizeOfIptrData - is that obsolete?  (Pavan Deolasee <pavan.deolasee@gmail.com>)
List pgsql-hackers
Pavan Deolasee <pavan.deolasee@gmail.com> writes:
> On Tue, Sep 20, 2016 at 8:34 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Realistically, because struct HeapTupleHeaderData contains a field of
>> type ItemPointerData, it's probably silly to imagine that we can save
>> anything if the compiler can't be persuaded to believe that
>> sizeof(ItemPointerData) is 6.  It may well be that the structure pragmas
>> work on everything that wouldn't natively believe that anyway.

> Yeah, that's what I thought and rest of the code seems to make that
> assumption as well. Attached patch removes the last remaining reference to
> SizeOfIptrData and also removes the macro and the associated comment.

I thought removing the comment altogether was not appropriate, because
it remains true that you want to work really hard to ensure that
sizeof(ItemPointerData) is 6.  We're just giving up on pretense of support
for compilers that don't believe that.  I'm half tempted to introduce a
StaticAssert about it, but refrained for the moment.

> While htup.h refactoring happened in 9.5, I don't see any point in back
> patching this.

Agreed.  Pushed to HEAD only.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: gratuitous casting away const
Next
From: Tom Lane
Date:
Subject: Re: Possibly too stringent Assert() in b-tree code