Changeset 68414 in webkit
- Timestamp:
- Sep 27, 2010 12:18:17 PM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r68405 r68414 1 2010-09-26 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Alexey Proskuryakov and Adam Barth. 4 5 Add WTF_MAKE_NONCOPYABLE macro 6 https://bugs.webkit.org/show_bug.cgi?id=46589 7 8 Going forward, we'd like to get rid of the Noncopyable and FastAllocBase classes. The 9 reason for this is that the Itanium C++ ABI states that no empty classes of the same type 10 can be laid out at the same offset in the class. This can result in objects getting larger 11 which leads to memory regressions. (One example of this is the String class which grew by 12 sizeof(void*) when both its base class and its first member variable inherited indirectly 13 from FastAllocBase). 14 15 * wtf/Noncopyable.h: 16 Add a WTF_MAKE_NONCOPYABLE macro and get rid of NoncopyableCustomAllocated. 17 18 * runtime/JSCell.h: 19 * wtf/RefCounted.h: 20 Don't inherit from NoncopyableCustomAllocated. Instead, use WTF_MAKE_NONCOPYABLE. 21 1 22 2010-09-27 Philippe Normand <pnormand@igalia.com> 2 23 -
trunk/JavaScriptCore/runtime/JSCell.h
r65146 r68414 35 35 namespace JSC { 36 36 37 class JSCell : public NoncopyableCustomAllocated { 37 class JSCell { 38 WTF_MAKE_NONCOPYABLE(JSCell); 39 38 40 friend class GetterSetter; 39 41 friend class Heap; -
trunk/JavaScriptCore/wtf/Noncopyable.h
r46933 r68414 22 22 #define WTF_Noncopyable_h 23 23 24 #ifndef __has_feature 25 #define __has_feature(x) 0 26 #endif 27 28 #if __has_feature(cxx_deleted_functions) 29 #define WTF_MAKE_NONCOPYABLE(ClassName) \ 30 _Pragma("clang diagnostic push") \ 31 _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") \ 32 _Pragma("clang diagnostic ignored \"-Wc++0x-extensions\"") \ 33 private: \ 34 ClassName(const ClassName&) = delete; \ 35 ClassName& operator=(const ClassName&) = delete; \ 36 _Pragma("clang diagnostic pop") 37 #else 38 #define WTF_MAKE_NONCOPYABLE(ClassName) \ 39 private: \ 40 ClassName(const ClassName&); \ 41 ClassName& operator=(const ClassName&); 42 #endif 43 24 44 // We don't want argument-dependent lookup to pull in everything from the WTF 25 45 // namespace when you use Noncopyable, so put it in its own namespace. … … 37 57 }; 38 58 39 class NoncopyableCustomAllocated {40 NoncopyableCustomAllocated(const NoncopyableCustomAllocated&);41 NoncopyableCustomAllocated& operator=(const NoncopyableCustomAllocated&);42 protected:43 NoncopyableCustomAllocated() { }44 ~NoncopyableCustomAllocated() { }45 };46 47 59 } // namespace WTFNoncopyable 48 60 49 61 using WTFNoncopyable::Noncopyable; 50 using WTFNoncopyable::NoncopyableCustomAllocated;51 62 52 63 #endif // WTF_Noncopyable_h -
trunk/JavaScriptCore/wtf/RefCounted.h
r62696 r68414 146 146 }; 147 147 148 template<typename T> class RefCountedCustomAllocated : public RefCountedBase, public NoncopyableCustomAllocated { 148 template<typename T> class RefCountedCustomAllocated : public RefCountedBase { 149 WTF_MAKE_NONCOPYABLE(RefCountedCustomAllocated); 150 149 151 public: 150 152 void deref()
Note: See TracChangeset
for help on using the changeset viewer.