unsigned CSSSelectorList::length() const { if (!m_selectorArray) return 0; CSSSelector* current = m_selectorArray; while (!current->isLastInSelectorList()) ++current; return (current - m_selectorArray) + 1; }
void CSSSelectorList::deleteSelectors() { if (!m_selectorArray) return; for (CSSSelector* s = m_selectorArray; !s->isLastInSelectorList(); ++s) s->~CSSSelector(); fastFree(m_selectorArray); }
void CSSSelectorList::deleteSelectors() { ASSERT(m_selectorArray); bool finished = false; for (CSSSelector* s = m_selectorArray; !finished; ++s) { finished = s->isLastInSelectorList(); s->~CSSSelector(); } WTF::Partitions::fastFree(m_selectorArray); }
void CSSSelectorList::deleteSelectors() { if (!m_selectorArray) return; for (CSSSelector* s = m_selectorArray; ; ++s) { s->~CSSSelector(); if (s->isLastInSelectorList()) break; } fastFree(m_selectorArray); }
void CSSSelectorList::deleteSelectors() { if (!m_selectorArray) return; bool finished = false; for (CSSSelector* s = m_selectorArray; !finished; ++s) { finished = s->isLastInSelectorList(); s->~CSSSelector(); } fastFree(m_selectorArray); }
void CSSSelectorList::deleteSelectors() { if (!m_selectorArray) return; // We had two cases in adoptSelectVector. The fast case of a 1 element // vector took the CSSSelector directly, which was allocated with new. // The second case we allocated a new fastMalloc buffer, which should be // freed with fastFree, and the destructors called manually. CSSSelector* s = m_selectorArray; bool done = s->isLastInSelectorList(); if (done) delete s; else { while (1) { s->~CSSSelector(); if (done) break; ++s; done = s->isLastInSelectorList(); } fastFree(m_selectorArray); } }