void MemoryManager::resetAllocator() { assert(m_natives.empty() && m_sweepables.empty()); // decref apc strings referenced by this request DEBUG_ONLY auto nstrings = StringData::sweepAll(); // cleanup root maps dropRootMaps(); // free the heap m_heap.reset(); // zero out freelists for (auto& i : m_freelists) i.head = nullptr; m_front = m_limit = 0; m_needInitFree = false; resetStatsImpl(true); FTRACE(1, "reset: strings {}\n", nstrings); }
void MemoryManager::resetAllocator() { assert(m_natives.empty() && m_sweepables.empty()); // decref apc strings and arrays referenced by this request DEBUG_ONLY auto napcs = m_apc_arrays.size(); while (!m_apc_arrays.empty()) { auto a = m_apc_arrays.back(); m_apc_arrays.pop_back(); a->sweep(); } DEBUG_ONLY auto nstrings = StringData::sweepAll(); // cleanup root maps dropRootMaps(); // free the heap m_heap.reset(); // zero out freelists for (auto& i : m_freelists) i.head = nullptr; m_front = m_limit = 0; resetStatsImpl(true); TRACE(1, "reset: apc-arrays %lu strings %u\n", napcs, nstrings); }