I would really like to write the handlers in terms of C++11 atomics. This would give us the best performance, portablity, and safety tradeoff. Unfortunately I can not yet do that. So I've put the desired code in comments, and reverted the handler getters to the slower but safer legacy atomic intrinsics.
llvm-svn: 153041
diff --git a/libcxxabi/src/cxa_handlers.hpp b/libcxxabi/src/cxa_handlers.hpp
index 95a320d..64994ac 100644
--- a/libcxxabi/src/cxa_handlers.hpp
+++ b/libcxxabi/src/cxa_handlers.hpp
@@ -35,6 +35,20 @@
extern void (*__cxa_unexpected_handler)();
extern void (*__cxa_new_handler)();
+/*
+
+ At some point in the future these three symbols will become
+ C++11 atomic variables:
+
+ extern std::atomic<std::terminate_handler> __cxa_terminate_handler;
+ extern std::atomic<std::unexpected_handler> __cxa_unexpected_handler;
+ extern std::atomic<std::new_handler> __cxa_new_handler;
+
+ This change will not impact their ABI. But it will allow for a
+ portible performance optimization.
+
+*/
+
} // extern "C"
#endif // _CXA_HANDLERS_H