Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: Source/wtf/Deque.h

Issue 1051853003: Oilpan: like Vector<T>, restrict Deque<T> to certain part objects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updated Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698