Changeset 80995 in webkit for trunk/Source/JavaScriptCore/runtime/ConservativeSet.cpp
- Timestamp:
- Mar 13, 2011, 9:56:46 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ConservativeSet.cpp
r80985 r80995 36 36 } 37 37 38 void Conservative Set::grow()38 void ConservativeRoots::grow() 39 39 { 40 40 size_t newCapacity = m_capacity == inlineCapacity ? nonInlineCapacity : m_capacity * 2; 41 JSCell** new Set= static_cast<JSCell**>(OSAllocator::reserveAndCommit(newCapacity * sizeof(JSCell*)));42 memcpy(new Set, m_set, m_size * sizeof(JSCell*));43 if (m_ set != m_inlineSet)44 OSAllocator::decommitAndRelease(m_ set, m_capacity * sizeof(JSCell*));41 JSCell** newRoots = static_cast<JSCell**>(OSAllocator::reserveAndCommit(newCapacity * sizeof(JSCell*))); 42 memcpy(newRoots, m_roots, m_size * sizeof(JSCell*)); 43 if (m_roots != m_inlineRoots) 44 OSAllocator::decommitAndRelease(m_roots, m_capacity * sizeof(JSCell*)); 45 45 m_capacity = newCapacity; 46 m_ set = newSet;46 m_roots = newRoots; 47 47 } 48 48 49 void Conservative Set::add(void* begin, void* end)49 void ConservativeRoots::add(void* begin, void* end) 50 50 { 51 51 ASSERT(begin <= end); … … 61 61 grow(); 62 62 63 m_ set[m_size++] = reinterpret_cast<JSCell*>(*it);63 m_roots[m_size++] = reinterpret_cast<JSCell*>(*it); 64 64 } 65 65 }
Note:
See TracChangeset
for help on using the changeset viewer.