[PATCH] D36078: [XRay][compiler-rt] Remove use of std::mutex and std::shared_ptr from global scope.

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 23:18:40 PDT 2017


dberris added a comment.

In https://reviews.llvm.org/D36078#826962, @kpw wrote:

> What's the primary motivation? Are we trying to avoid the upfront cost of global initialization? The unspecified destructor ordering with multithreaded programs?


The primary motivation is to avoid the initialization of atomics at initialization time. This has caused some issues in the past with dynamic linking and relocations.

It also allows us to start removing the dependencies on the C++ standard library in the implementation. Using raw pointers gets us there, and not using std::mutex gets us there closer.


https://reviews.llvm.org/D36078





More information about the llvm-commits mailing list