path: root/paludis/util/attributes.hh
diff options
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-01-28 18:19:36 -0800
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-02-14 23:12:29 -0800
commite42d5ffe29b4cd6cf9bac0f36fe37ec5001dfd68 (patch)
tree618a32afdb1555e9944e68f379695b7dfe6a1234 /paludis/util/attributes.hh
parente0f11780797f6ddee5bdfd965c7f499e8810c2b4 (diff)
switch TLS to C++11 TLS semantics
Rather than using the compiler specific `__thread` mechanism for TLS, use the C++11 standard `thread_local` keyword. This removes the check for the `__thread` keyword and the `PALUDIS_TLS` macro in the single usage site. Take advantage of the fact that `thread_local` can be applied to non-POD types to avoid the heap allocation of the context buffer and letting the loader perform the allocation. This has a slight penalty (an extra function call) on thread construction. However, given that the heap allocation would likely be performed, this will be largely offset by the loss of the allocation.
Diffstat (limited to 'paludis/util/attributes.hh')
1 files changed, 0 insertions, 2 deletions
diff --git a/paludis/util/attributes.hh b/paludis/util/attributes.hh
index 270fbc393..88877f602 100644
--- a/paludis/util/attributes.hh
+++ b/paludis/util/attributes.hh
@@ -63,6 +63,4 @@
# define PALUDIS_HIDDEN PALUDIS_ATTRIBUTE((visibility("hidden")))
-#define PALUDIS_TLS static __thread