diff options
author | Abseil Team <absl-team@google.com> | 2018-10-25 02:04:43 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-10-26 18:19:59 (GMT) |
commit | b57c703963be1ca9749b902c49083beac56648aa (patch) | |
tree | b7f5433fce3803d121c9963dc69bcdeec4d35f7c /googletest/src/gtest-port.cc | |
parent | a50e4f05b3d84c6a014c59a24263328242cc8236 (diff) | |
download | googletest-b57c703963be1ca9749b902c49083beac56648aa.zip googletest-b57c703963be1ca9749b902c49083beac56648aa.tar.gz googletest-b57c703963be1ca9749b902c49083beac56648aa.tar.bz2 |
Googletest export
Remove linked_ptr and use std::shared_ptr instead
PiperOrigin-RevId: 218618184
Diffstat (limited to 'googletest/src/gtest-port.cc')
-rw-r--r-- | googletest/src/gtest-port.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index 082aaff..aa98ddb 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -31,11 +31,10 @@ #include "gtest/internal/gtest-port.h" #include <limits.h> -#include <stdio.h> #include <stdlib.h> +#include <stdio.h> #include <string.h> #include <fstream> -#include <memory> #if GTEST_OS_WINDOWS # include <windows.h> @@ -476,7 +475,7 @@ class ThreadLocalRegistryImpl { thread_local_values .insert(std::make_pair( thread_local_instance, - std::shared_ptr<ThreadLocalValueHolderBase>( + linked_ptr<ThreadLocalValueHolderBase>( thread_local_instance->NewValueForCurrentThread()))) .first; } @@ -485,7 +484,7 @@ class ThreadLocalRegistryImpl { static void OnThreadLocalDestroyed( const ThreadLocalBase* thread_local_instance) { - std::vector<std::shared_ptr<ThreadLocalValueHolderBase> > value_holders; + std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders; // Clean up the ThreadLocalValues data structure while holding the lock, but // defer the destruction of the ThreadLocalValueHolderBases. { @@ -513,7 +512,7 @@ class ThreadLocalRegistryImpl { static void OnThreadExit(DWORD thread_id) { GTEST_CHECK_(thread_id != 0) << ::GetLastError(); - std::vector<std::shared_ptr<ThreadLocalValueHolderBase> > value_holders; + std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders; // Clean up the ThreadIdToThreadLocals data structure while holding the // lock, but defer the destruction of the ThreadLocalValueHolderBases. { @@ -540,8 +539,7 @@ class ThreadLocalRegistryImpl { private: // In a particular thread, maps a ThreadLocal object to its value. typedef std::map<const ThreadLocalBase*, - std::shared_ptr<ThreadLocalValueHolderBase> > - ThreadLocalValues; + linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues; // Stores all ThreadIdToThreadLocals having values in a thread, indexed by // thread's ID. typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals; |