diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index 12b9a8bd3ce3..402fcad9ddae 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -177,19 +177,14 @@ bool GCToEEInterface::IsPreemptiveGCDisabled() bool GCToEEInterface::EnablePreemptiveGC() { - bool bToggleGC = false; Thread* pThread = ::GetThread(); - - if (pThread) + if (pThread && pThread->PreemptiveGCDisabled()) { - bToggleGC = !!pThread->PreemptiveGCDisabled(); - if (bToggleGC) - { - pThread->EnablePreemptiveGC(); - } + pThread->EnablePreemptiveGC(); + return true; } - return bToggleGC; + return false; } void GCToEEInterface::DisablePreemptiveGC() diff --git a/src/gc/sample/gcenv.h b/src/gc/sample/gcenv.h index 0da2e4402366..b14625b3a339 100644 --- a/src/gc/sample/gcenv.h +++ b/src/gc/sample/gcenv.h @@ -92,7 +92,7 @@ struct alloc_context; class Thread { - uint32_t m_fPreemptiveGCDisabled; + bool m_fPreemptiveGCDisabled; uintptr_t m_alloc_context[16]; // Reserve enough space to fix allocation context friend class ThreadStore; @@ -105,7 +105,7 @@ class Thread bool PreemptiveGCDisabled() { - return !!m_fPreemptiveGCDisabled; + return m_fPreemptiveGCDisabled; } void EnablePreemptiveGC() diff --git a/src/gc/unix/events.cpp b/src/gc/unix/events.cpp index 96dba6030e92..820475c0df22 100644 --- a/src/gc/unix/events.cpp +++ b/src/gc/unix/events.cpp @@ -146,7 +146,7 @@ class GCEvent::Impl TimeSpecAdd(&endTime, milliseconds); } #else -#error "Don't know how to perfom timed wait on this platform" +#error "Don't know how to perform timed wait on this platform" #endif int st = 0; diff --git a/src/md/enc/metamodelrw.cpp b/src/md/enc/metamodelrw.cpp index 96f313b8fb8f..cd9e26a45cec 100644 --- a/src/md/enc/metamodelrw.cpp +++ b/src/md/enc/metamodelrw.cpp @@ -1422,7 +1422,7 @@ CMiniMdRW::InitOnMem( int iCol; // Look at all the tables, or until mixed sizes are discovered. - for (i=0; i<(int)m_TblCount && fMixed == false; i++) + for (i=0; i<(int)m_TblCount && !fMixed; i++) { // Look at all the columns of the table. pCols = m_TableDefs[i].m_pColDefs; for (iCol = 0; iCol < m_TableDefs[i].m_cCols && !fMixed; iCol++) @@ -1430,15 +1430,13 @@ CMiniMdRW::InitOnMem( if (!IsFixedType(m_TableDefs[i].m_pColDefs[iCol].m_Type)) { // If this is the first non-fixed size column... if (iSize == 0) - { // remember it's size. + { // remember its size. iSize = m_TableDefs[i].m_pColDefs[iCol].m_cbColumn; } - else - { // Not first non-fixed size, so if a different size... - if (iSize != m_TableDefs[i].m_pColDefs[iCol].m_cbColumn) - { // ...the table has mixed column sizes. - fMixed = true; - } + else if (iSize != m_TableDefs[i].m_pColDefs[iCol].m_cbColumn) + { // Not first non-fixed size, so if a different size + // the table has mixed column sizes. + fMixed = true; } } } @@ -1449,18 +1447,15 @@ CMiniMdRW::InitOnMem( IfFailGo(ExpandTables()); ComputeGrowLimits(FALSE /* ! small*/); } + else if (iSize == 2) + { + // small schema + ComputeGrowLimits(TRUE /* small */); + } else { - if (iSize == 2) - { - // small schema - ComputeGrowLimits(TRUE /* small */); - } - else - { - // large schema - ComputeGrowLimits(FALSE /* ! small */); - } + // large schema + ComputeGrowLimits(FALSE /* ! small */); } } else diff --git a/src/vm/gcenv.ee.cpp b/src/vm/gcenv.ee.cpp index aeaf6fb9186d..34a1ec699478 100644 --- a/src/vm/gcenv.ee.cpp +++ b/src/vm/gcenv.ee.cpp @@ -369,31 +369,23 @@ bool GCToEEInterface::IsPreemptiveGCDisabled() WRAPPER_NO_CONTRACT; Thread* pThread = ::GetThread(); - if (pThread) - { - return !!pThread->PreemptiveGCDisabled(); - } - - return false; + + return (pThread && pThread->PreemptiveGCDisabled()); } bool GCToEEInterface::EnablePreemptiveGC() { WRAPPER_NO_CONTRACT; - bool bToggleGC = false; Thread* pThread = ::GetThread(); - if (pThread) + if (pThread && pThread->PreemptiveGCDisabled()) { - bToggleGC = !!pThread->PreemptiveGCDisabled(); - if (bToggleGC) - { - pThread->EnablePreemptiveGC(); - } + pThread->EnablePreemptiveGC(); + return true; } - return bToggleGC; + return false; } void GCToEEInterface::DisablePreemptiveGC()