Ticket #280 (closed enhancement: fixed)

Opened 10 years ago

Last modified 10 years ago

[Patch] atomic.h should use GCC builtins

Reported by: ppalmers Assigned to:
Priority: minor Milestone: FFADO 2.x
Component: generic Version: FFADO 2.0.0
Keywords: Cc:
The device the bug applies to:


Comment from Lennart Poettering:

5) Atomic.h should be updated to make use of the gcc sync builtins

when available. They are nowadays supported on almost all archs and support the full set of atomic ops. If you have them then you don't need implement those operations manually based on the CAS. I have seen that you currently use sync_bool_compare_and_swap() as a fallback. But it should be the first choice nowadays. Both PA and glib have been using sync now for a while and by default. While we initially had problems with some of the code generated this has long been fixed since then in gcc.


ffado-builtin-atomics.patch (3.5 kB) - added by adi on 07/21/10 10:47:19.

Change History

05/09/10 02:36:22 changed by ppalmers

  • type changed from bug to enhancement.

07/21/10 10:47:19 changed by adi

  • attachment ffado-builtin-atomics.patch added.

07/21/10 10:48:48 changed by adi

  • summary changed from atomic.h should use GCC builtins to [Patch] atomic.h should use GCC builtins.

I just provided the corresponding patch. This is what lennart has proposed, and I think he's perfectly right here.

We've been using this fallback for quite some time in Debian's jackd2 package.

09/13/10 01:34:57 changed by adi

I've been using this patch for a couple of month, both personally and in Debian. I think we're safe to apply...

12/07/10 03:38:43 changed by adi

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r1933.