Re: Bring atomic flag fallback up to snuff

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: Bring atomic flag fallback up to snuff
Date: 2018-04-07 18:30:16
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 2018-04-07 14:23:38 -0400, Tom Lane wrote:
> I think I'd just drop those asserts altogether. The hardware is in charge
> of complaining about misaligned pointers.

Well, the problem is that some atomics operations on some platforms do
not fail for unaligned pointers, they just loose their atomic
property. Fun times.

> If you do insist on asserting something, it needs to be about ptr->sema;
> the bool value field isn't going to have any interesting alignment
> requirement, but the sema might.

The alignment requirements of sema is going to be taken care of by
normal alignment rules, otherwise we'd be in trouble all over the tree

Think I'll just drop it from the general branch, and add it to the
generic gcc implementation that uses a four byte value (because of arm
and the like).


Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Seltenreich 2018-04-07 18:33:43 [sqlsmith] Failed assertion on pfree() via perform_pruning_combine_step
Previous Message Tom Lane 2018-04-07 18:23:38 Re: Bring atomic flag fallback up to snuff