Unverified Commit c38f4b9f authored by Gennadiy Civil's avatar Gennadiy Civil Committed by GitHub
Browse files

Small style changes.

Just small style changes and we can accept this PR
parent f3a9fa6a
......@@ -306,7 +306,7 @@ namespace {
//
class MemoryIsNotDeallocated
{
public:
public:
MemoryIsNotDeallocated() : old_crtdbg_flag_(0) {
#ifdef _MSC_VER
old_crtdbg_flag_ = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
......@@ -323,7 +323,7 @@ public:
#endif // _MSC_VER
}
private:
private:
int old_crtdbg_flag_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(MemoryIsNotDeallocated);
......@@ -584,17 +584,11 @@ class ThreadLocalRegistryImpl {
return 0;
}
// Return a newly constructed ThreadIdToThreadLocals that's intentionally never deleted
static ThreadIdToThreadLocals* NewThreadIdToThreadLocals() {
// Use RAII to flag that following mem alloc is never deallocated.
MemoryIsNotDeallocated memory_is_not_deallocated;
return new ThreadIdToThreadLocals;
}
// Returns map of thread local instances.
static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
mutex_.AssertHeld();
static ThreadIdToThreadLocals* map = NewThreadIdToThreadLocals();
MemoryIsNotDeallocated memory_is_not_deallocated;
static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals();
return map;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment