| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef HeapAllocator_h | 5 #ifndef HeapAllocator_h |
| 6 #define HeapAllocator_h | 6 #define HeapAllocator_h |
| 7 | 7 |
| 8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
| 9 #include "platform/heap/TraceTraits.h" | 9 #include "platform/heap/TraceTraits.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 HeapVector(size_t size, const T& val) : Vector<T, inlineCapacity, HeapAlloca
tor>(size, val) | 364 HeapVector(size_t size, const T& val) : Vector<T, inlineCapacity, HeapAlloca
tor>(size, val) |
| 365 { | 365 { |
| 366 } | 366 } |
| 367 | 367 |
| 368 template<size_t otherCapacity> | 368 template<size_t otherCapacity> |
| 369 HeapVector(const HeapVector<T, otherCapacity>& other) | 369 HeapVector(const HeapVector<T, otherCapacity>& other) |
| 370 : Vector<T, inlineCapacity, HeapAllocator>(other) | 370 : Vector<T, inlineCapacity, HeapAllocator>(other) |
| 371 { | 371 { |
| 372 } | 372 } |
| 373 | |
| 374 template<typename U> | |
| 375 void append(const U* data, size_t dataSize) | |
| 376 { | |
| 377 Vector<T, inlineCapacity, HeapAllocator>::append(data, dataSize); | |
| 378 } | |
| 379 | |
| 380 template<typename U> | |
| 381 void append(const U& other) | |
| 382 { | |
| 383 Vector<T, inlineCapacity, HeapAllocator>::append(other); | |
| 384 } | |
| 385 | |
| 386 template<typename U, size_t otherCapacity> | |
| 387 void appendVector(const HeapVector<U, otherCapacity>& other) | |
| 388 { | |
| 389 const Vector<U, otherCapacity, HeapAllocator>& otherVector = other; | |
| 390 Vector<T, inlineCapacity, HeapAllocator>::appendVector(otherVector); | |
| 391 } | |
| 392 }; | 373 }; |
| 393 | 374 |
| 394 template<typename T, size_t inlineCapacity = 0> | 375 template<typename T, size_t inlineCapacity = 0> |
| 395 class HeapDeque : public Deque<T, inlineCapacity, HeapAllocator> { | 376 class HeapDeque : public Deque<T, inlineCapacity, HeapAllocator> { |
| 396 public: | 377 public: |
| 397 HeapDeque() { } | 378 HeapDeque() { } |
| 398 | 379 |
| 399 explicit HeapDeque(size_t size) : Deque<T, inlineCapacity, HeapAllocator>(si
ze) | 380 explicit HeapDeque(size_t size) : Deque<T, inlineCapacity, HeapAllocator>(si
ze) |
| 400 { | 381 { |
| 401 } | 382 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 template<typename T, size_t i, typename U> | 423 template<typename T, size_t i, typename U> |
| 443 inline void swap(HeapListHashSet<T, i, U>& a, HeapListHashSet<T, i, U>& b) { a.s
wap(b); } | 424 inline void swap(HeapListHashSet<T, i, U>& a, HeapListHashSet<T, i, U>& b) { a.s
wap(b); } |
| 444 template<typename T, typename U, typename V> | 425 template<typename T, typename U, typename V> |
| 445 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) {
a.swap(b); } | 426 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) {
a.swap(b); } |
| 446 template<typename T, typename U, typename V> | 427 template<typename T, typename U, typename V> |
| 447 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b)
{ a.swap(b); } | 428 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b)
{ a.swap(b); } |
| 448 | 429 |
| 449 } // namespace blink | 430 } // namespace blink |
| 450 | 431 |
| 451 #endif | 432 #endif |
| OLD | NEW |