Changeset 80995 in webkit for trunk/Source/JavaScriptCore/runtime/ConservativeSet.h
- Timestamp:
- Mar 13, 2011, 9:56:46 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ConservativeSet.h
r80985 r80995 24 24 */ 25 25 26 #ifndef Conservative Set_h27 #define Conservative Set_h26 #ifndef ConservativeRoots_h 27 #define ConservativeRoots_h 28 28 29 29 #include <wtf/OSAllocator.h> … … 37 37 // May contain duplicates. 38 38 39 class Conservative Set{39 class ConservativeRoots { 40 40 public: 41 Conservative Set(Heap*);42 ~Conservative Set();41 ConservativeRoots(Heap*); 42 ~ConservativeRoots(); 43 43 44 44 void add(void* begin, void* end); 45 45 46 46 size_t size(); 47 JSCell** set();47 JSCell** roots(); 48 48 49 49 private: … … 54 54 55 55 Heap* m_heap; 56 JSCell** m_ set;56 JSCell** m_roots; 57 57 size_t m_size; 58 58 size_t m_capacity; 59 JSCell* m_inline Set[inlineCapacity];59 JSCell* m_inlineRoots[inlineCapacity]; 60 60 }; 61 61 62 inline Conservative Set::ConservativeSet(Heap* heap)62 inline ConservativeRoots::ConservativeRoots(Heap* heap) 63 63 : m_heap(heap) 64 , m_ set(m_inlineSet)64 , m_roots(m_inlineRoots) 65 65 , m_size(0) 66 66 , m_capacity(inlineCapacity) … … 68 68 } 69 69 70 inline Conservative Set::~ConservativeSet()70 inline ConservativeRoots::~ConservativeRoots() 71 71 { 72 if (m_ set != m_inlineSet)73 OSAllocator::decommitAndRelease(m_ set, m_capacity * sizeof(JSCell*));72 if (m_roots != m_inlineRoots) 73 OSAllocator::decommitAndRelease(m_roots, m_capacity * sizeof(JSCell*)); 74 74 } 75 75 76 inline size_t Conservative Set::size()76 inline size_t ConservativeRoots::size() 77 77 { 78 78 return m_size; 79 79 } 80 80 81 inline JSCell** Conservative Set::set()81 inline JSCell** ConservativeRoots::roots() 82 82 { 83 return m_ set;83 return m_roots; 84 84 } 85 85 86 86 } // namespace JSC 87 87 88 #endif // Conservative Set_h88 #endif // ConservativeRoots_h
Note:
See TracChangeset
for help on using the changeset viewer.