gatomic: use GCC C11-style atomics, if available
GCC does not yet support ISO C11 atomic operations, but it has compatible versions available as an extension. Use these for load and store if they are available in order to avoid emitting a hard fence instruction (since in many cases, we do not need it -- on x86, for example). For now we use the fully seqentially-consistent memory model, since these APIs are documented rather explicitly: "This call acts as a full compiler and hardware memory barrier". In the future we can consider introducing new APIs for the more relaxed memory models, if they are available (or fall back to stricter ones otherwise). https://bugzilla.gnome.org/show_bug.cgi?id=730807
parent
875eeb2c
Please register or sign in to comment