aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest-port.cc
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/src/gtest-port.cc')
-rw-r--r--googletest/src/gtest-port.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc
index 082aaff4..aa98ddb1 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;