[NFC] Replace HEADER_GLOBAL with inline (C++17).

HEADER_GLOBAL was using non-standard attributes to achieve what C++17
now permits with a keyword.  Use the standard formulation.

Update the README to note that gcc is still not recommended, but because
of its poor codegen for 128-bit atomic compare and exchange, rather than
because it doesn't support the attribute used for HEADER_GLOBAL.
This commit is contained in:
David Chisnall
2019-08-13 14:03:37 +01:00
committed by David Chisnall
parent bbf016bac8
commit 6dbe24da2e
5 changed files with 7 additions and 16 deletions

View File

@@ -3,7 +3,6 @@
#ifdef _MSC_VER
# define ALWAYSINLINE __forceinline
# define NOINLINE __declspec(noinline)
# define HEADER_GLOBAL __declspec(selectany)
# define likely(x) !!(x)
# define unlikely(x) !!(x)
# define SNMALLOC_SLOW_PATH NOINLINE
@@ -17,13 +16,6 @@
# define SNMALLOC_SLOW_PATH NOINLINE
# define SNMALLOC_FAST_PATH inline ALWAYSINLINE
# define SNMALLOC_PURE __attribute__((const))
# ifdef __clang__
# define HEADER_GLOBAL __attribute__((selectany))
# else
// GCC does not support selectany, weak is almost the correct
// attribute, but leaves the global variable preemptible.
# define HEADER_GLOBAL __attribute__((weak))
# endif
#endif
#ifndef __has_builtin