assertClear();
}
+ void sortFree()
+ {
+ std::sort(m_free.begin(), m_free.end());
+ }
+
void assertClear()
{
-#if !ASSERT_DISABLED
+ if (ASSERT_DISABLED)
+ return;
+
// For every entry in the used list the use count of the virtual register should be zero, or max, due to it being a preserved local.
for (size_t i = 0; i < m_used.size(); ++i)
- ASSERT(!m_used[i] || m_used[i] == max());
+ RELEASE_ASSERT(!m_used[i] || m_used[i] == max());
// For every entry in the free list, the use count should be zero.
for (size_t i = 0; i < m_free.size(); ++i)
- ASSERT(!m_used[m_free[i]]);
+ RELEASE_ASSERT(!m_used[m_free[i]]);
// There must not be duplicates in the free list.
for (size_t i = 0; i < m_free.size(); ++i) {
for (size_t j = i + 1; j < m_free.size(); ++j)
- ASSERT(m_free[i] != m_free[j]);
+ RELEASE_ASSERT(m_free[i] != m_free[j]);
}
-#endif
}
VirtualRegister allocate()