Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals) - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
Date
Msg-id d7a788fa-e609-4894-a8be-2f70e135424f@eisentraut.org
Whole thread Raw
In response to Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
List pgsql-hackers
On 13.02.26 09:03, Bertrand Drouvot wrote:
> +/*
> + * If compiler understands aligned pragma, use it to align the struct at cache
> + * line boundaries.  This is just for performance, to (a) avoid false sharing
> + * and (b) to make the multiplication / division to convert between PGPROC *
> + * and ProcNumber be a little cheaper.
> + */
> +#if defined(pg_attribute_aligned)
> +                       pg_attribute_aligned(PG_CACHE_LINE_SIZE)
> +#endif
> +PGPROC;

You can/should use C11 standard alignas(), so you don't need to worry 
about whether it's supported or not.




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: meson: Allow disabling static libraries
Next
From: Peter Eisentraut
Date:
Subject: Re: some validate_relation_kind() tidying