void MemoryManager::resetRuntimeOptions() { if (debug) { deleteRootMaps(); checkHeap(); // check that every allocation in heap has been freed before reset iterate([&](Header* h) { assert(h->kind() == HeaderKind::Free); }); } MemoryManager::TlsWrapper::destroy(); // ~MemoryManager() MemoryManager::TlsWrapper::getCheck(); // new MemeoryManager() }
void MemoryManager::resetRuntimeOptions() { if (debug) { deleteRootMaps(); checkHeap(); // check that every allocation in heap has been freed before reset for (auto h = begin(), lim = end(); h != lim; ++h) { if (h->kind_ == HeaderKind::Debug) { auto h2 = h; ++h2; if (h2 != lim) { assert(h2->kind_ == HeaderKind::Free); } } else { assert(h->kind_ == HeaderKind::Free || h->kind_ == HeaderKind::Hole); } } } MemoryManager::TlsWrapper::destroy(); MemoryManager::TlsWrapper::getCheck(); }