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/Persistent.h" | 9 #include "platform/heap/Persistent.h" |
10 #include "platform/heap/TraceTraits.h" | 10 #include "platform/heap/TraceTraits.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 typename HashArg = typename DefaultHash<ValueArg>::Hash, | 366 typename HashArg = typename DefaultHash<ValueArg>::Hash, |
367 typename TraitsArg = HashTraits<ValueArg>> | 367 typename TraitsArg = HashTraits<ValueArg>> |
368 class HeapLinkedHashSet | 368 class HeapLinkedHashSet |
369 : public LinkedHashSet<ValueArg, HashArg, TraitsArg, HeapAllocator> { | 369 : public LinkedHashSet<ValueArg, HashArg, TraitsArg, HeapAllocator> { |
370 IS_GARBAGE_COLLECTED_TYPE(); | 370 IS_GARBAGE_COLLECTED_TYPE(); |
371 static_assert(WTF::IsTraceable<ValueArg>::value, | 371 static_assert(WTF::IsTraceable<ValueArg>::value, |
372 "For sets without traceable elements, use LinkedHashSet<> " | 372 "For sets without traceable elements, use LinkedHashSet<> " |
373 "instead of HeapLinkedHashSet<>"); | 373 "instead of HeapLinkedHashSet<>"); |
374 }; | 374 }; |
375 | 375 |
376 template < | 376 template <typename ValueArg, |
377 typename ValueArg, | 377 size_t inlineCapacity = 0, // The inlineCapacity is just a dummy to |
378 size_t inlineCapacity = | 378 // match ListHashSet (off-heap). |
379 0, // The inlineCapacity is just a dummy to match ListHashSet (off-heap
). | 379 typename HashArg = typename DefaultHash<ValueArg>::Hash> |
380 typename HashArg = typename DefaultHash<ValueArg>::Hash> | |
381 class HeapListHashSet | 380 class HeapListHashSet |
382 : public ListHashSet<ValueArg, | 381 : public ListHashSet<ValueArg, |
383 inlineCapacity, | 382 inlineCapacity, |
384 HashArg, | 383 HashArg, |
385 HeapListHashSetAllocator<ValueArg, inlineCapacity>> { | 384 HeapListHashSetAllocator<ValueArg, inlineCapacity>> { |
386 IS_GARBAGE_COLLECTED_TYPE(); | 385 IS_GARBAGE_COLLECTED_TYPE(); |
387 static_assert(WTF::IsTraceable<ValueArg>::value, | 386 static_assert(WTF::IsTraceable<ValueArg>::value, |
388 "For sets without traceable elements, use ListHashSet<> " | 387 "For sets without traceable elements, use ListHashSet<> " |
389 "instead of HeapListHashSet<>"); | 388 "instead of HeapListHashSet<>"); |
390 }; | 389 }; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, | 719 const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, |
721 VectorType& vector) { | 720 VectorType& vector) { |
722 copyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, | 721 copyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, |
723 blink::HeapAllocator>&>(set), | 722 blink::HeapAllocator>&>(set), |
724 vector); | 723 vector); |
725 } | 724 } |
726 | 725 |
727 } // namespace WTF | 726 } // namespace WTF |
728 | 727 |
729 #endif | 728 #endif |
OLD | NEW |