| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // postfix ++ intentionally omitted | 218 // postfix ++ intentionally omitted |
| 219 Iterator& operator--() { Base::decrement(); return *this; } | 219 Iterator& operator--() { Base::decrement(); return *this; } |
| 220 // postfix -- intentionally omitted | 220 // postfix -- intentionally omitted |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 template<typename T, size_t inlineCapacity, typename Allocator> | 223 template<typename T, size_t inlineCapacity, typename Allocator> |
| 224 inline Deque<T, inlineCapacity, Allocator>::Deque() | 224 inline Deque<T, inlineCapacity, Allocator>::Deque() |
| 225 : m_start(0) | 225 : m_start(0) |
| 226 , m_end(0) | 226 , m_end(0) |
| 227 { | 227 { |
| 228 static_assert(!IsPolymorphic<T>::value || !VectorTraits<T>::canInitializ
eWithMemset, "Cannot initialize with memset if there is a vtable"); |
| 229 #if ENABLE(OILPAN) |
| 230 static_assert(Allocator::isGarbageCollected || !IsAllowOnlyInlineAllocat
ion<T>::value || !NeedsTracing<T>::value, "Cannot put ALLOW_ONLY_INLINE_ALLOCATI
ON objects that have trace methods into an off-heap Deque"); |
| 231 #endif |
| 228 } | 232 } |
| 229 | 233 |
| 230 template<typename T, size_t inlineCapacity, typename Allocator> | 234 template<typename T, size_t inlineCapacity, typename Allocator> |
| 231 inline Deque<T, inlineCapacity, Allocator>::Deque(const Deque<T, inlineCapac
ity, Allocator>& other) | 235 inline Deque<T, inlineCapacity, Allocator>::Deque(const Deque<T, inlineCapac
ity, Allocator>& other) |
| 232 : m_buffer(other.m_buffer.capacity()) | 236 : m_buffer(other.m_buffer.capacity()) |
| 233 , m_start(other.m_start) | 237 , m_start(other.m_start) |
| 234 , m_end(other.m_end) | 238 , m_end(other.m_end) |
| 235 { | 239 { |
| 236 const T* otherBuffer = other.m_buffer.buffer(); | 240 const T* otherBuffer = other.m_buffer.buffer(); |
| 237 if (m_start <= m_end) | 241 if (m_start <= m_end) |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 struct NeedsTracing<Deque<T, N>> { | 569 struct NeedsTracing<Deque<T, N>> { |
| 566 static const bool value = false; | 570 static const bool value = false; |
| 567 }; | 571 }; |
| 568 #endif | 572 #endif |
| 569 | 573 |
| 570 } // namespace WTF | 574 } // namespace WTF |
| 571 | 575 |
| 572 using WTF::Deque; | 576 using WTF::Deque; |
| 573 | 577 |
| 574 #endif // WTF_Deque_h | 578 #endif // WTF_Deque_h |
| OLD | NEW |