Changeset 39897 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Jan 14, 2009, 11:07:48 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ByteArray.h
r39631 r39897 31 31 32 32 namespace JSC { 33 class ByteArray : public RefCounted<ByteArray>{33 class ByteArray : public WTF::RefCountedBase { 34 34 public: 35 35 unsigned length() const { return m_size; } … … 56 56 unsigned char* data() { return m_data; } 57 57 58 void deref() 59 { 60 if (derefBase()) { 61 // We allocated with new unsigned char[] in create(), 62 // and then used placement new to construct the object. 63 this->~ByteArray(); 64 delete[] reinterpret_cast<unsigned char*>(this); 65 } 66 } 67 58 68 static PassRefPtr<ByteArray> create(size_t size); 59 69 60 70 private: 61 71 ByteArray(size_t size) 62 : m_size(size) 72 : RefCountedBase(1) 73 , m_size(size) 63 74 { 64 75 }
Note:
See TracChangeset
for help on using the changeset viewer.