Changeset 76457 in webkit for trunk/Source/JavaScriptCore/runtime/ConservativeSet.cpp
- Timestamp:
- Jan 22, 2011, 9:03:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ConservativeSet.cpp
r76454 r76457 34 34 } 35 35 36 void ConservativeSet::grow() 37 { 38 size_t newCapacity = m_capacity == inlineCapacity ? nonInlineCapacity : m_capacity * 2; 39 JSCell** newSet = static_cast<JSCell**>(OSAllocator::reserveAndCommit(newCapacity * sizeof(JSCell*))); 40 memcpy(newSet, m_set, m_size * sizeof(JSCell*)); 41 if (m_set != m_inlineSet) 42 OSAllocator::decommitAndRelease(m_set, m_capacity * sizeof(JSCell*)); 43 m_capacity = newCapacity; 44 m_set = newSet; 45 } 46 36 47 void ConservativeSet::add(void* begin, void* end) 37 48 { … … 44 55 if (!m_heap->contains(*it)) 45 56 continue; 46 m_vector.append(reinterpret_cast<JSCell*>(*it)); 57 58 if (m_size == m_capacity) 59 grow(); 60 61 m_set[m_size++] = reinterpret_cast<JSCell*>(*it); 47 62 } 48 63 }
Note:
See TracChangeset
for help on using the changeset viewer.