OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 | 1315 |
1316 template<typename T, size_t inlineCapacity = 0> | 1316 template<typename T, size_t inlineCapacity = 0> |
1317 class HeapVector : public Vector<T, inlineCapacity, HeapAllocator> { | 1317 class HeapVector : public Vector<T, inlineCapacity, HeapAllocator> { |
1318 public: | 1318 public: |
1319 HeapVector() { } | 1319 HeapVector() { } |
1320 | 1320 |
1321 explicit HeapVector(size_t size) : Vector<T, inlineCapacity, HeapAllocator>(
size) | 1321 explicit HeapVector(size_t size) : Vector<T, inlineCapacity, HeapAllocator>(
size) |
1322 { | 1322 { |
1323 } | 1323 } |
1324 | 1324 |
| 1325 HeapVector(size_t size, const T& val) : Vector<T, inlineCapacity, HeapAlloca
tor>(size, val) |
| 1326 { |
| 1327 } |
| 1328 |
1325 template<size_t otherCapacity> | 1329 template<size_t otherCapacity> |
1326 HeapVector(const HeapVector<T, otherCapacity>& other) | 1330 HeapVector(const HeapVector<T, otherCapacity>& other) |
1327 : Vector<T, inlineCapacity, HeapAllocator>(other) | 1331 : Vector<T, inlineCapacity, HeapAllocator>(other) |
1328 { | 1332 { |
1329 } | 1333 } |
1330 | 1334 |
1331 template<typename U> | 1335 template<typename U> |
1332 void append(const U& other) | 1336 void append(const U& other) |
1333 { | 1337 { |
1334 Vector<T, inlineCapacity, HeapAllocator>::append(other); | 1338 Vector<T, inlineCapacity, HeapAllocator>::append(other); |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 // to export. This forces it to export all the methods from ThreadHeap. | 1693 // to export. This forces it to export all the methods from ThreadHeap. |
1690 template<> void ThreadHeap<FinalizedHeapObjectHeader>::addPageToHeap(const GCInf
o*); | 1694 template<> void ThreadHeap<FinalizedHeapObjectHeader>::addPageToHeap(const GCInf
o*); |
1691 template<> void ThreadHeap<HeapObjectHeader>::addPageToHeap(const GCInfo*); | 1695 template<> void ThreadHeap<HeapObjectHeader>::addPageToHeap(const GCInfo*); |
1692 extern template class HEAP_EXPORT ThreadHeap<FinalizedHeapObjectHeader>; | 1696 extern template class HEAP_EXPORT ThreadHeap<FinalizedHeapObjectHeader>; |
1693 extern template class HEAP_EXPORT ThreadHeap<HeapObjectHeader>; | 1697 extern template class HEAP_EXPORT ThreadHeap<HeapObjectHeader>; |
1694 #endif | 1698 #endif |
1695 | 1699 |
1696 } | 1700 } |
1697 | 1701 |
1698 #endif // Heap_h | 1702 #endif // Heap_h |
OLD | NEW |