diff options
author | Dean Michael Berris <dberris@google.com> | 2017-09-21 10:16:56 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2017-09-21 10:16:56 +0000 |
commit | 1fc69acfb655e2088be9d08716148cd8dccc4448 (patch) | |
tree | 6e26731d32f0fb374de1a6e38a10c5c38814f8db /lib | |
parent | 28ad3fe834d87731a13a712bb92c8f56ecbc0aec (diff) |
[XRay][compiler-rt] Remove non-trivial globals from xray_log_interface.cc
Summary:
Remove dependency on std::unique_ptr<...> for the global representing
the installed XRay implementation.
Reviewers: dblaikie, kpw, pelikan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38121
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xray/xray_log_interface.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/xray/xray_log_interface.cc b/lib/xray/xray_log_interface.cc index ee14ae4b1..5cc6ade0f 100644 --- a/lib/xray/xray_log_interface.cc +++ b/lib/xray/xray_log_interface.cc @@ -17,30 +17,30 @@ #include "xray/xray_interface.h" #include "xray_defs.h" -#include <memory> - __sanitizer::SpinMutex XRayImplMutex; -std::unique_ptr<XRayLogImpl> GlobalXRayImpl; +XRayLogImpl *GlobalXRayImpl = nullptr; void __xray_set_log_impl(XRayLogImpl Impl) XRAY_NEVER_INSTRUMENT { if (Impl.log_init == nullptr || Impl.log_finalize == nullptr || Impl.handle_arg0 == nullptr || Impl.flush_log == nullptr) { __sanitizer::SpinMutexLock Guard(&XRayImplMutex); - GlobalXRayImpl.reset(); + delete GlobalXRayImpl; + GlobalXRayImpl = nullptr; __xray_remove_handler(); __xray_remove_handler_arg1(); return; } __sanitizer::SpinMutexLock Guard(&XRayImplMutex); - GlobalXRayImpl.reset(new XRayLogImpl); + GlobalXRayImpl = new XRayLogImpl(); *GlobalXRayImpl = Impl; __xray_set_handler(Impl.handle_arg0); } void __xray_remove_log_impl() XRAY_NEVER_INSTRUMENT { __sanitizer::SpinMutexLock Guard(&XRayImplMutex); - GlobalXRayImpl.reset(); + delete GlobalXRayImpl; + GlobalXRayImpl = nullptr; __xray_remove_handler(); __xray_remove_handler_arg1(); } |