| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 void remove(const_iterator&); | 106 void remove(const_iterator&); |
| 107 | 107 |
| 108 void clear(); | 108 void clear(); |
| 109 | 109 |
| 110 template <typename Predicate> | 110 template <typename Predicate> |
| 111 iterator findIf(Predicate&); | 111 iterator findIf(Predicate&); |
| 112 | 112 |
| 113 template <typename VisitorDispatcher> void trace(VisitorDispatcher); | 113 template <typename VisitorDispatcher> void trace(VisitorDispatcher); |
| 114 | 114 |
| 115 static_assert(!std::is_polymorphic<T>::value || !VectorTraits<T>::canInitial
izeWithMemset, "Cannot initialize with memset if there is a vtable"); | 115 static_assert(!std::is_polymorphic<T>::value || !VectorTraits<T>::canInitial
izeWithMemset, "Cannot initialize with memset if there is a vtable"); |
| 116 #if ENABLE(OILPAN) | |
| 117 static_assert(Allocator::isGarbageCollected || !AllowsOnlyPlacementNew<T>::v
alue || !NeedsTracing<T>::value, "Cannot put DISALLOW_NEW_EXCEPT_PLACEMENT_NEW o
bjects that have trace methods into an off-heap Deque"); | 116 static_assert(Allocator::isGarbageCollected || !AllowsOnlyPlacementNew<T>::v
alue || !NeedsTracing<T>::value, "Cannot put DISALLOW_NEW_EXCEPT_PLACEMENT_NEW o
bjects that have trace methods into an off-heap Deque"); |
| 118 #endif | |
| 119 static_assert(Allocator::isGarbageCollected || !IsPointerToGarbageCollectedT
ype<T>::value, "Cannot put raw pointers to garbage-collected classes into a Dequ
e. Use HeapDeque<Member<T>> instead."); | 117 static_assert(Allocator::isGarbageCollected || !IsPointerToGarbageCollectedT
ype<T>::value, "Cannot put raw pointers to garbage-collected classes into a Dequ
e. Use HeapDeque<Member<T>> instead."); |
| 120 | 118 |
| 121 private: | 119 private: |
| 122 friend class DequeIteratorBase<T, inlineCapacity, Allocator>; | 120 friend class DequeIteratorBase<T, inlineCapacity, Allocator>; |
| 123 | 121 |
| 124 class BackingBuffer : public VectorBuffer<T, INLINE_CAPACITY, Allocator> { | 122 class BackingBuffer : public VectorBuffer<T, INLINE_CAPACITY, Allocator> { |
| 125 WTF_MAKE_NONCOPYABLE(BackingBuffer); | 123 WTF_MAKE_NONCOPYABLE(BackingBuffer); |
| 126 private: | 124 private: |
| 127 using Base = VectorBuffer<T, INLINE_CAPACITY, Allocator>; | 125 using Base = VectorBuffer<T, INLINE_CAPACITY, Allocator>; |
| 128 using Base::m_size; | 126 using Base::m_size; |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 if (m_buffer.hasOutOfLineBuffer()) | 611 if (m_buffer.hasOutOfLineBuffer()) |
| 614 Allocator::markNoTracing(visitor, m_buffer.buffer()); | 612 Allocator::markNoTracing(visitor, m_buffer.buffer()); |
| 615 } | 613 } |
| 616 | 614 |
| 617 template <typename T, size_t inlineCapacity, typename Allocator> | 615 template <typename T, size_t inlineCapacity, typename Allocator> |
| 618 inline void swap(Deque<T, inlineCapacity, Allocator>& a, Deque<T, inlineCapacity
, Allocator>& b) | 616 inline void swap(Deque<T, inlineCapacity, Allocator>& a, Deque<T, inlineCapacity
, Allocator>& b) |
| 619 { | 617 { |
| 620 a.swap(b); | 618 a.swap(b); |
| 621 } | 619 } |
| 622 | 620 |
| 623 #if !ENABLE(OILPAN) | |
| 624 template <typename T, size_t N> | |
| 625 struct NeedsTracing<Deque<T, N>> { | |
| 626 static const bool value = false; | |
| 627 }; | |
| 628 #endif | |
| 629 | |
| 630 } // namespace WTF | 621 } // namespace WTF |
| 631 | 622 |
| 632 using WTF::Deque; | 623 using WTF::Deque; |
| 633 | 624 |
| 634 #endif // WTF_Deque_h | 625 #endif // WTF_Deque_h |
| OLD | NEW |