Re: __attribute__ for non-gcc compilers

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Oskari Saarenmaa <os(at)ohmu(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: __attribute__ for non-gcc compilers
Date: 2015-01-14 22:46:39
Message-ID: CA+TgmobLfdkH+EX6pZNcHCWEaEEuZ+JYYKBjSP0Vc3o_kfELNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 14, 2015 at 5:29 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> I think it's better than the alternatives:
>
> a) Don't support 64bit atomics on any 32bit platform. I think that'd be
> sad because there's some places that could greatly benefit from being
> able to read/store/manipulate e.g. LSNs atomically.
> b) Double the size of 64bit atomics on 32bit platforms, and add
> TYPEALIGN() to every access inside the atomics implementation.
> c) Require 64 atomics to be aligned appropriately manually in every
> place they're embedded. I think that's completely impractical.
>
> The only viable one imo is a)

I can't really fault that reasoning, but if __attribute__((align))
only works on some platforms, then you've got silent, subtle breakage
on the ones where it doesn't.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-01-14 22:54:52 Re: __attribute__ for non-gcc compilers
Previous Message Andres Freund 2015-01-14 22:29:30 Re: __attribute__ for non-gcc compilers