Changeset 76457 in webkit for trunk/Source/JavaScriptCore/runtime/ConservativeSet.h
- Timestamp:
- Jan 22, 2011, 9:03:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ConservativeSet.h
r76454 r76457 38 38 public: 39 39 ConservativeSet(Heap*); 40 ~ConservativeSet(); 40 41 41 42 void add(void* begin, void* end); … … 43 44 44 45 private: 46 static const size_t inlineCapacity = 128; 47 static const size_t nonInlineCapacity = 8192 / sizeof(JSCell*); 48 49 void grow(); 50 45 51 Heap* m_heap; 46 Vector<JSCell*, 64> m_vector; 52 JSCell** m_set; 53 size_t m_size; 54 size_t m_capacity; 55 JSCell* m_inlineSet[inlineCapacity]; 47 56 }; 48 57 49 58 inline ConservativeSet::ConservativeSet(Heap* heap) 50 59 : m_heap(heap) 60 , m_set(m_inlineSet) 61 , m_size(0) 62 , m_capacity(inlineCapacity) 51 63 { 64 } 65 66 inline ConservativeSet::~ConservativeSet() 67 { 68 if (m_set != m_inlineSet) 69 OSAllocator::decommitAndRelease(m_set, m_capacity * sizeof(JSCell*)); 52 70 } 53 71 54 72 inline void ConservativeSet::mark(MarkStack& markStack) 55 73 { 56 for (size_t i = 0; i < m_ vector.size(); ++i)57 markStack.append(m_ vector[i]);74 for (size_t i = 0; i < m_size; ++i) 75 markStack.append(m_set[i]); 58 76 } 59 77
Note:
See TracChangeset
for help on using the changeset viewer.