Re: Making type Datum be 8 bytes everywhere - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Making type Datum be 8 bytes everywhere
Date
Msg-id 1621064.1757540104@sss.pgh.pa.us
Whole thread Raw
In response to Re: Making type Datum be 8 bytes everywhere  (Tomas Vondra <tomas@vondra.me>)
List pgsql-hackers
Tomas Vondra <tomas@vondra.me> writes:
> On 9/10/25 22:35, Tom Lane wrote:
>> This is silently assuming that sizeof(SortItem) is a multiple of
>> alignof(Datum), which on a 32-bit-pointer platform is not true
>> any longer.  We ought to MAXALIGN the two occurrences of
>> data->numrows * sizeof(SortItem).

> You're right, I misunderstood which of the accesses is triggering the
> report. I added the two MAXALIGNs and can confirm that makes it go away
> on the rpi5. It's interesting it didn't happen on the i386 machine at
> all, but I don't have time to look at why right now.

I think it's just that i386 doesn't have hardware-level alignment
restrictions, or at least not ones for more than 4 bytes.

>> Do you want to fix it, or shall I?

> Feel free to do so. If not, I'll do that on Monday.

I can deal with it today, will go do so.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Making type Datum be 8 bytes everywhere
Next
From: Jacob Champion
Date:
Subject: Re: OAuth client code doesn't work with Google OAuth