Changeset 155484 in webkit
- Timestamp:
- Sep 10, 2013, 3:36:23 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/Alignment.h (modified) (1 diff)
-
WTF/wtf/Vector.h (modified) (4 diffs)
-
WTF/wtf/text/ASCIIFastPath.h (modified) (2 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/PODArena.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r155483 r155484 1 2013-09-10 Anders Carlsson <andersca@apple.com> 2 3 More WTF/Alignment.h removal 4 https://bugs.webkit.org/show_bug.cgi?id=121125 5 6 Reviewed by Andreas Kling. 7 8 * wtf/Alignment.h: 9 * wtf/Vector.h: 10 (WTF::VectorBuffer::swap): 11 (WTF::VectorBuffer::inlineBuffer): 12 * wtf/text/ASCIIFastPath.h: 13 (WTF::isAlignedTo): 14 (WTF::isAlignedToMachineWord): 15 1 16 2013-09-10 Brent Fulgham <bfulgham@apple.com> 2 17 -
trunk/Source/WTF/wtf/Alignment.h
r150134 r155484 61 61 } 62 62 63 template <uintptr_t mask>64 inline bool isAlignedTo(const void* pointer)65 {66 return !(reinterpret_cast<uintptr_t>(pointer) & mask);67 }68 63 } 69 64 -
trunk/Source/WTF/wtf/Vector.h
r155308 r155484 22 22 #define WTF_Vector_h 23 23 24 #include <wtf/Alignment.h> 24 #include <limits> 25 #include <string.h> 26 #include <type_traits> 27 #include <utility> 25 28 #include <wtf/CheckedArithmetic.h> 26 29 #include <wtf/FastMalloc.h> … … 31 34 #include <wtf/ValueCheck.h> 32 35 #include <wtf/VectorTraits.h> 33 #include <limits>34 #include <string.h>35 #include <utility>36 36 37 37 namespace WTF { … … 456 456 } 457 457 458 void swap(VectorBuffer <T, inlineCapacity>& other)458 void swap(VectorBuffer& other) 459 459 { 460 460 if (buffer() == inlineBuffer() && other.buffer() == other.inlineBuffer()) { 461 WTF::swap(m_inlineBuffer, other.m_inlineBuffer);461 std::swap_ranges(m_inlineBuffer, m_inlineBuffer + inlineCapacity, other.m_inlineBuffer); 462 462 std::swap(m_capacity, other.m_capacity); 463 463 } else if (buffer() == inlineBuffer()) { 464 464 m_buffer = other.m_buffer; 465 465 other.m_buffer = other.inlineBuffer(); 466 WTF::swap(m_inlineBuffer, other.m_inlineBuffer);466 std::swap_ranges(m_inlineBuffer, m_inlineBuffer + inlineCapacity, other.m_inlineBuffer); 467 467 std::swap(m_capacity, other.m_capacity); 468 468 } else if (other.buffer() == other.inlineBuffer()) { 469 469 other.m_buffer = m_buffer; 470 470 m_buffer = inlineBuffer(); 471 WTF::swap(m_inlineBuffer, other.m_inlineBuffer);471 std::swap_ranges(m_inlineBuffer, m_inlineBuffer + inlineCapacity, other.m_inlineBuffer); 472 472 std::swap(m_capacity, other.m_capacity); 473 473 } else { … … 502 502 using Base::m_capacity; 503 503 504 static const size_t m_inlineBufferSize = inlineCapacity * sizeof(T); 505 T* inlineBuffer() { return reinterpret_cast_ptr<T*>(m_inlineBuffer.buffer); } 506 const T* inlineBuffer() const { return reinterpret_cast_ptr<const T*>(m_inlineBuffer.buffer); } 507 508 AlignedBuffer<m_inlineBufferSize, WTF_ALIGN_OF(T)> m_inlineBuffer; 504 T* inlineBuffer() { return reinterpret_cast_ptr<T*>(m_inlineBuffer); } 505 const T* inlineBuffer() const { return reinterpret_cast_ptr<const T*>(m_inlineBuffer); } 506 507 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_inlineBuffer[inlineCapacity]; 509 508 }; 510 509 -
trunk/Source/WTF/wtf/text/ASCIIFastPath.h
r144811 r155484 33 33 namespace WTF { 34 34 35 template <uintptr_t mask> 36 inline bool isAlignedTo(const void* pointer) 37 { 38 return !(reinterpret_cast<uintptr_t>(pointer) & mask); 39 } 40 35 41 // Assuming that a pointer is the size of a "machine word", then 36 42 // uintptr_t is an integer type that is also a machine word. … … 40 46 inline bool isAlignedToMachineWord(const void* pointer) 41 47 { 42 return !(reinterpret_cast<uintptr_t>(pointer) & machineWordAlignmentMask);48 return isAlignedTo<machineWordAlignmentMask>(pointer); 43 49 } 44 50 -
trunk/Source/WebCore/ChangeLog
r155478 r155484 1 2013-09-10 Anders Carlsson <andersca@apple.com> 2 3 More WTF/Alignment.h removal 4 https://bugs.webkit.org/show_bug.cgi?id=121125 5 6 Reviewed by Andreas Kling. 7 8 * platform/PODArena.h: 9 1 10 2013-09-10 Eric Carlson <eric.carlson@apple.com> 2 11 -
trunk/Source/WebCore/platform/PODArena.h
r150932 r155484 28 28 29 29 #include <stdint.h> 30 #include <wtf/Alignment.h> 30 31 #include <wtf/Assertions.h> 31 32 #include <wtf/FastMalloc.h>
Note:
See TracChangeset
for help on using the changeset viewer.