/root/bitcoin/src/prevector.h
Line | Count | Source |
1 | | // Copyright (c) 2015-present The Bitcoin Core developers |
2 | | // Distributed under the MIT software license, see the accompanying |
3 | | // file COPYING or http://www.opensource.org/licenses/mit-license.php. |
4 | | |
5 | | #ifndef BITCOIN_PREVECTOR_H |
6 | | #define BITCOIN_PREVECTOR_H |
7 | | |
8 | | #include <algorithm> |
9 | | #include <cassert> |
10 | | #include <cstdint> |
11 | | #include <cstdlib> |
12 | | #include <cstring> |
13 | | #include <iterator> |
14 | | #include <new> |
15 | | #include <type_traits> |
16 | | #include <utility> |
17 | | |
18 | | /** Implements a drop-in replacement for std::vector<T> which stores up to N |
19 | | * elements directly (without heap allocation). The types Size and Diff are |
20 | | * used to store element counts, and can be any unsigned + signed type. |
21 | | * |
22 | | * Storage layout is either: |
23 | | * - Direct allocation: |
24 | | * - Size _size: the number of used elements (between 0 and N) |
25 | | * - T direct[N]: an array of N elements of type T |
26 | | * (only the first _size are initialized). |
27 | | * - Indirect allocation: |
28 | | * - Size _size: the number of used elements plus N + 1 |
29 | | * - Size capacity: the number of allocated elements |
30 | | * - T* indirect: a pointer to an array of capacity elements of type T |
31 | | * (only the first _size are initialized). |
32 | | * |
33 | | * The data type T must be movable by memmove/realloc(). Once we switch to C++, |
34 | | * move constructors can be used instead. |
35 | | */ |
36 | | template<unsigned int N, typename T, typename Size = uint32_t, typename Diff = int32_t> |
37 | | class prevector { |
38 | | static_assert(std::is_trivially_copyable_v<T>); |
39 | | |
40 | | public: |
41 | | static constexpr unsigned int STATIC_SIZE{N}; |
42 | | |
43 | | typedef Size size_type; |
44 | | typedef Diff difference_type; |
45 | | typedef T value_type; |
46 | | typedef value_type& reference; |
47 | | typedef const value_type& const_reference; |
48 | | typedef value_type* pointer; |
49 | | typedef const value_type* const_pointer; |
50 | | |
51 | | class iterator { |
52 | | T* ptr{}; |
53 | | public: |
54 | | typedef Diff difference_type; |
55 | | typedef T* pointer; |
56 | | typedef T& reference; |
57 | | using element_type = T; |
58 | | using iterator_category = std::contiguous_iterator_tag; |
59 | | iterator() = default; |
60 | 605M | iterator(T* ptr_) : ptr(ptr_) {}_ZN9prevectorILj16EhjiE8iteratorC2EPh Line | Count | Source | 60 | 74.1M | iterator(T* ptr_) : ptr(ptr_) {} |
_ZN9prevectorILj36EhjiE8iteratorC2EPh Line | Count | Source | 60 | 530M | iterator(T* ptr_) : ptr(ptr_) {} |
_ZN9prevectorILj8EijiE8iteratorC2EPi Line | Count | Source | 60 | 686k | iterator(T* ptr_) : ptr(ptr_) {} |
_ZN9prevectorILj33EhjiE8iteratorC2EPh Line | Count | Source | 60 | 66 | iterator(T* ptr_) : ptr(ptr_) {} |
_ZN9prevectorILj35EhjiE8iteratorC2EPh Line | Count | Source | 60 | 272k | iterator(T* ptr_) : ptr(ptr_) {} |
|
61 | 1.57G | T& operator*() const { return *ptr; }_ZNK9prevectorILj36EhjiE8iteratordeEv Line | Count | Source | 61 | 1.42G | T& operator*() const { return *ptr; } |
_ZNK9prevectorILj16EhjiE8iteratordeEv Line | Count | Source | 61 | 148M | T& operator*() const { return *ptr; } |
_ZNK9prevectorILj8EijiE8iteratordeEv Line | Count | Source | 61 | 810k | T& operator*() const { return *ptr; } |
_ZNK9prevectorILj33EhjiE8iteratordeEv Line | Count | Source | 61 | 132 | T& operator*() const { return *ptr; } |
_ZNK9prevectorILj35EhjiE8iteratordeEv Line | Count | Source | 61 | 272k | T& operator*() const { return *ptr; } |
|
62 | 0 | T* operator->() const { return ptr; }Unexecuted instantiation: _ZNK9prevectorILj33EhjiE8iteratorptEv Unexecuted instantiation: _ZNK9prevectorILj36EhjiE8iteratorptEv Unexecuted instantiation: _ZNK9prevectorILj16EhjiE8iteratorptEv Unexecuted instantiation: _ZNK9prevectorILj35EhjiE8iteratorptEv |
63 | | T& operator[](size_type pos) const { return ptr[pos]; } |
64 | 981M | iterator& operator++() { ptr++; return *this; } |
65 | | iterator& operator--() { ptr--; return *this; } |
66 | | iterator operator++(int) { iterator copy(*this); ++(*this); return copy; } |
67 | | iterator operator--(int) { iterator copy(*this); --(*this); return copy; } |
68 | 245M | difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }_ZmiN9prevectorILj36EhjiE8iteratorES1_ Line | Count | Source | 68 | 220M | difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); } |
_ZmiN9prevectorILj16EhjiE8iteratorES1_ Line | Count | Source | 68 | 24.7M | difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); } |
_ZmiN9prevectorILj8EijiE8iteratorES1_ Line | Count | Source | 68 | 197k | difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); } |
_ZmiN9prevectorILj33EhjiE8iteratorES1_ Line | Count | Source | 68 | 22 | difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); } |
_ZmiN9prevectorILj35EhjiE8iteratorES1_ Line | Count | Source | 68 | 136k | difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); } |
|
69 | 145k | iterator operator+(size_type n) const { return iterator(ptr + n); }_ZNK9prevectorILj36EhjiE8iteratorplEj Line | Count | Source | 69 | 256 | iterator operator+(size_type n) const { return iterator(ptr + n); } |
_ZNK9prevectorILj8EijiE8iteratorplEj Line | Count | Source | 69 | 145k | iterator operator+(size_type n) const { return iterator(ptr + n); } |
_ZNK9prevectorILj33EhjiE8iteratorplEj Line | Count | Source | 69 | 22 | iterator operator+(size_type n) const { return iterator(ptr + n); } |
|
70 | | iterator friend operator+(size_type n, iterator x) { return x + n; } |
71 | | iterator& operator+=(size_type n) { ptr += n; return *this; } |
72 | 12.4k | iterator operator-(size_type n) const { return iterator(ptr - n); } |
73 | | iterator& operator-=(size_type n) { ptr -= n; return *this; } |
74 | 984M | bool operator==(iterator x) const { return ptr == x.ptr; } |
75 | 0 | auto operator<=>(iterator x) const { return ptr <=> x.ptr; }Unexecuted instantiation: _ZNK9prevectorILj33EhjiE8iteratorssES1_ Unexecuted instantiation: _ZNK9prevectorILj36EhjiE8iteratorssES1_ Unexecuted instantiation: _ZNK9prevectorILj16EhjiE8iteratorssES1_ Unexecuted instantiation: _ZNK9prevectorILj35EhjiE8iteratorssES1_ |
76 | | }; |
77 | | |
78 | | class const_iterator { |
79 | | const T* ptr{}; |
80 | | public: |
81 | | typedef Diff difference_type; |
82 | | typedef const T* pointer; |
83 | | typedef const T& reference; |
84 | | using element_type = const T; |
85 | | using iterator_category = std::contiguous_iterator_tag; |
86 | | const_iterator() = default; |
87 | 6.78G | const_iterator(const T* ptr_) : ptr(ptr_) {}_ZN9prevectorILj16EhjiE14const_iteratorC2EPKh Line | Count | Source | 87 | 3.24G | const_iterator(const T* ptr_) : ptr(ptr_) {} |
_ZN9prevectorILj36EhjiE14const_iteratorC2EPKh Line | Count | Source | 87 | 3.53G | const_iterator(const T* ptr_) : ptr(ptr_) {} |
_ZN9prevectorILj8EijiE14const_iteratorC2EPKi Line | Count | Source | 87 | 9.56M | const_iterator(const T* ptr_) : ptr(ptr_) {} |
|
88 | 1.54M | const_iterator(iterator x) : ptr(&(*x)) {} |
89 | 75.8G | const T& operator*() const { return *ptr; }_ZNK9prevectorILj36EhjiE14const_iteratordeEv Line | Count | Source | 89 | 57.2G | const T& operator*() const { return *ptr; } |
_ZNK9prevectorILj16EhjiE14const_iteratordeEv Line | Count | Source | 89 | 18.4G | const T& operator*() const { return *ptr; } |
_ZNK9prevectorILj8EijiE14const_iteratordeEv Line | Count | Source | 89 | 137M | const T& operator*() const { return *ptr; } |
|
90 | 0 | const T* operator->() const { return ptr; }Unexecuted instantiation: _ZNK9prevectorILj36EhjiE14const_iteratorptEv Unexecuted instantiation: _ZNK9prevectorILj16EhjiE14const_iteratorptEv |
91 | 3.27M | const T& operator[](size_type pos) const { return ptr[pos]; }_ZNK9prevectorILj8EijiE14const_iteratorixEj Line | Count | Source | 91 | 1.58M | const T& operator[](size_type pos) const { return ptr[pos]; } |
_ZNK9prevectorILj36EhjiE14const_iteratorixEj Line | Count | Source | 91 | 1.68M | const T& operator[](size_type pos) const { return ptr[pos]; } |
|
92 | 68.0G | const_iterator& operator++() { ptr++; return *this; }_ZN9prevectorILj36EhjiE14const_iteratorppEv Line | Count | Source | 92 | 52.5G | const_iterator& operator++() { ptr++; return *this; } |
_ZN9prevectorILj16EhjiE14const_iteratorppEv Line | Count | Source | 92 | 15.3G | const_iterator& operator++() { ptr++; return *this; } |
_ZN9prevectorILj8EijiE14const_iteratorppEv Line | Count | Source | 92 | 131M | const_iterator& operator++() { ptr++; return *this; } |
|
93 | 6.32M | const_iterator& operator--() { ptr--; return *this; }_ZN9prevectorILj8EijiE14const_iteratormmEv Line | Count | Source | 93 | 6.32M | const_iterator& operator--() { ptr--; return *this; } |
Unexecuted instantiation: _ZN9prevectorILj36EhjiE14const_iteratormmEv |
94 | 893M | const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; } |
95 | | const_iterator operator--(int) { const_iterator copy(*this); --(*this); return copy; } |
96 | 2.39G | difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }_ZmiN9prevectorILj36EhjiE14const_iteratorES1_ Line | Count | Source | 96 | 2.11G | difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); } |
_ZmiN9prevectorILj16EhjiE14const_iteratorES1_ Line | Count | Source | 96 | 276M | difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); } |
_ZmiN9prevectorILj8EijiE14const_iteratorES1_ Line | Count | Source | 96 | 36.5k | difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); } |
|
97 | 219M | const_iterator operator+(size_type n) const { return const_iterator(ptr + n); }_ZNK9prevectorILj8EijiE14const_iteratorplEj Line | Count | Source | 97 | 3.16M | const_iterator operator+(size_type n) const { return const_iterator(ptr + n); } |
_ZNK9prevectorILj36EhjiE14const_iteratorplEj Line | Count | Source | 97 | 216M | const_iterator operator+(size_type n) const { return const_iterator(ptr + n); } |
|
98 | | const_iterator friend operator+(size_type n, const_iterator x) { return x + n; } |
99 | 318M | const_iterator& operator+=(size_type n) { ptr += n; return *this; } |
100 | 2.04M | const_iterator operator-(size_type n) const { return const_iterator(ptr - n); }_ZNK9prevectorILj8EijiE14const_iteratormiEj Line | Count | Source | 100 | 1.58M | const_iterator operator-(size_type n) const { return const_iterator(ptr - n); } |
_ZNK9prevectorILj36EhjiE14const_iteratormiEj Line | Count | Source | 100 | 464k | const_iterator operator-(size_type n) const { return const_iterator(ptr - n); } |
|
101 | | const_iterator& operator-=(size_type n) { ptr -= n; return *this; } |
102 | 62.4G | bool operator==(const_iterator x) const { return ptr == x.ptr; }_ZNK9prevectorILj36EhjiE14const_iteratoreqES1_ Line | Count | Source | 102 | 47.7G | bool operator==(const_iterator x) const { return ptr == x.ptr; } |
_ZNK9prevectorILj16EhjiE14const_iteratoreqES1_ Line | Count | Source | 102 | 14.6G | bool operator==(const_iterator x) const { return ptr == x.ptr; } |
_ZNK9prevectorILj8EijiE14const_iteratoreqES1_ Line | Count | Source | 102 | 131M | bool operator==(const_iterator x) const { return ptr == x.ptr; } |
|
103 | 1.20G | auto operator<=>(const_iterator x) const { return ptr <=> x.ptr; }_ZNK9prevectorILj36EhjiE14const_iteratorssES1_ Line | Count | Source | 103 | 1.20G | auto operator<=>(const_iterator x) const { return ptr <=> x.ptr; } |
Unexecuted instantiation: _ZNK9prevectorILj16EhjiE14const_iteratorssES1_ Unexecuted instantiation: _ZNK9prevectorILj8EijiE14const_iteratorssES1_ |
104 | | }; |
105 | | |
106 | | private: |
107 | | #pragma pack(push, 1) |
108 | | union direct_or_indirect { |
109 | | char direct[sizeof(T) * N]; |
110 | | struct { |
111 | | char* indirect; |
112 | | size_type capacity; |
113 | | } indirect_contents; |
114 | | }; |
115 | | #pragma pack(pop) |
116 | | alignas(char*) direct_or_indirect _union = {}; |
117 | | size_type _size = 0; |
118 | | |
119 | | static_assert(alignof(char*) % alignof(size_type) == 0 && sizeof(char*) % alignof(size_type) == 0, "size_type cannot have more restrictive alignment requirement than pointer"); |
120 | | static_assert(alignof(char*) % alignof(T) == 0, "value_type T cannot have more restrictive alignment requirement than pointer"); |
121 | | |
122 | 1.61G | T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }_ZN9prevectorILj36EhjiE10direct_ptrEi Line | Count | Source | 122 | 893M | T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; } |
_ZN9prevectorILj33EhjiE10direct_ptrEi Line | Count | Source | 122 | 4.16M | T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; } |
_ZN9prevectorILj16EhjiE10direct_ptrEi Line | Count | Source | 122 | 712M | T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; } |
_ZN9prevectorILj8EijiE10direct_ptrEi Line | Count | Source | 122 | 267k | T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; } |
_ZN9prevectorILj35EhjiE10direct_ptrEi Line | Count | Source | 122 | 545k | T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; } |
Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiE10direct_ptrEi |
123 | 8.31G | const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }_ZNK9prevectorILj36EhjiE10direct_ptrEi Line | Count | Source | 123 | 3.86G | const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; } |
_ZNK9prevectorILj16EhjiE10direct_ptrEi Line | Count | Source | 123 | 4.45G | const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; } |
_ZNK9prevectorILj8EijiE10direct_ptrEi Line | Count | Source | 123 | 44.3k | const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; } |
_ZNK9prevectorILj33EhjiE10direct_ptrEi Line | Count | Source | 123 | 1.00M | const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; } |
|
124 | 775M | T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }_ZN9prevectorILj36EhjiE12indirect_ptrEi Line | Count | Source | 124 | 580M | T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; } |
_ZN9prevectorILj33EhjiE12indirect_ptrEi Line | Count | Source | 124 | 580 | T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; } |
_ZN9prevectorILj16EhjiE12indirect_ptrEi Line | Count | Source | 124 | 194M | T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; } |
_ZN9prevectorILj8EijiE12indirect_ptrEi Line | Count | Source | 124 | 536k | T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; } |
Unexecuted instantiation: _ZN9prevectorILj35EhjiE12indirect_ptrEi Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiE12indirect_ptrEi |
125 | 1.95G | const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }_ZNK9prevectorILj36EhjiE12indirect_ptrEi Line | Count | Source | 125 | 1.24G | const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; } |
_ZNK9prevectorILj16EhjiE12indirect_ptrEi Line | Count | Source | 125 | 703M | const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; } |
_ZNK9prevectorILj8EijiE12indirect_ptrEi Line | Count | Source | 125 | 11.1M | const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; } |
_ZNK9prevectorILj33EhjiE12indirect_ptrEi Line | Count | Source | 125 | 180 | const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; } |
|
126 | 45.4G | bool is_direct() const { return _size <= N; }_ZNK9prevectorILj36EhjiE9is_directEv Line | Count | Source | 126 | 34.2G | bool is_direct() const { return _size <= N; } |
_ZNK9prevectorILj33EhjiE9is_directEv Line | Count | Source | 126 | 16.1M | bool is_direct() const { return _size <= N; } |
_ZNK9prevectorILj16EhjiE9is_directEv Line | Count | Source | 126 | 11.1G | bool is_direct() const { return _size <= N; } |
_ZNK9prevectorILj8EijiE9is_directEv Line | Count | Source | 126 | 14.5M | bool is_direct() const { return _size <= N; } |
_ZNK9prevectorILj35EhjiE9is_directEv Line | Count | Source | 126 | 1.29M | bool is_direct() const { return _size <= N; } |
Unexecuted instantiation: _ZNK9prevectorILj4E7NetworkjiE9is_directEv |
127 | | |
128 | 1.23G | void change_capacity(size_type new_capacity) { |
129 | 1.23G | if (new_capacity <= N) { Branch (129:13): [True: 613M, False: 17.7M]
Branch (129:13): [True: 418M, False: 179M]
Branch (129:13): [True: 1.00M, False: 580]
Branch (129:13): [True: 14.9k, False: 47.9k]
Branch (129:13): [True: 68.1k, False: 0]
Branch (129:13): [True: 0, False: 0]
|
130 | 1.03G | if (!is_direct()) { Branch (130:17): [True: 59.9k, False: 613M]
Branch (130:17): [True: 0, False: 418M]
Branch (130:17): [True: 0, False: 1.00M]
Branch (130:17): [True: 2.98k, False: 11.9k]
Branch (130:17): [True: 0, False: 68.1k]
Branch (130:17): [True: 0, False: 0]
|
131 | 62.9k | T* indirect = indirect_ptr(0); |
132 | 62.9k | T* src = indirect; |
133 | 62.9k | T* dst = direct_ptr(0); |
134 | 62.9k | memcpy(dst, src, size() * sizeof(T)); |
135 | 62.9k | free(indirect); |
136 | 62.9k | _size -= N + 1; |
137 | 62.9k | } |
138 | 1.03G | } else { |
139 | 197M | if (!is_direct()) { Branch (139:17): [True: 1.45M, False: 16.3M]
Branch (139:17): [True: 0, False: 179M]
Branch (139:17): [True: 0, False: 580]
Branch (139:17): [True: 28.1k, False: 19.8k]
Branch (139:17): [True: 0, False: 0]
Branch (139:17): [True: 0, False: 0]
|
140 | | /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert |
141 | | success. These should instead use an allocator or new/delete so that handlers |
142 | | are called as necessary, but performance would be slightly degraded by doing so. */ |
143 | 1.48M | _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity)); |
144 | 1.48M | assert(_union.indirect_contents.indirect); Branch (144:17): [True: 1.45M, False: 0]
Branch (144:17): [True: 0, False: 0]
Branch (144:17): [True: 0, False: 0]
Branch (144:17): [True: 28.1k, False: 0]
Branch (144:17): [True: 0, False: 0]
Branch (144:17): [True: 0, False: 0]
|
145 | 1.48M | _union.indirect_contents.capacity = new_capacity; |
146 | 195M | } else { |
147 | 195M | char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity)); |
148 | 195M | assert(new_indirect); Branch (148:17): [True: 16.3M, False: 18.4E]
Branch (148:17): [True: 179M, False: 0]
Branch (148:17): [True: 580, False: 0]
Branch (148:17): [True: 19.8k, False: 0]
Branch (148:17): [True: 0, False: 0]
Branch (148:17): [True: 0, False: 0]
|
149 | 195M | T* src = direct_ptr(0); |
150 | 195M | T* dst = reinterpret_cast<T*>(new_indirect); |
151 | 195M | memcpy(dst, src, size() * sizeof(T)); |
152 | 195M | _union.indirect_contents.indirect = new_indirect; |
153 | 195M | _union.indirect_contents.capacity = new_capacity; |
154 | 195M | _size += N + 1; |
155 | 195M | } |
156 | 197M | } |
157 | 1.23G | } _ZN9prevectorILj36EhjiE15change_capacityEj Line | Count | Source | 128 | 631M | void change_capacity(size_type new_capacity) { | 129 | 631M | if (new_capacity <= N) { Branch (129:13): [True: 613M, False: 17.7M]
| 130 | 613M | if (!is_direct()) { Branch (130:17): [True: 59.9k, False: 613M]
| 131 | 59.9k | T* indirect = indirect_ptr(0); | 132 | 59.9k | T* src = indirect; | 133 | 59.9k | T* dst = direct_ptr(0); | 134 | 59.9k | memcpy(dst, src, size() * sizeof(T)); | 135 | 59.9k | free(indirect); | 136 | 59.9k | _size -= N + 1; | 137 | 59.9k | } | 138 | 613M | } else { | 139 | 17.7M | if (!is_direct()) { Branch (139:17): [True: 1.45M, False: 16.3M]
| 140 | | /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert | 141 | | success. These should instead use an allocator or new/delete so that handlers | 142 | | are called as necessary, but performance would be slightly degraded by doing so. */ | 143 | 1.45M | _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity)); | 144 | 1.45M | assert(_union.indirect_contents.indirect); Branch (144:17): [True: 1.45M, False: 0]
| 145 | 1.45M | _union.indirect_contents.capacity = new_capacity; | 146 | 16.3M | } else { | 147 | 16.3M | char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity)); | 148 | 16.3M | assert(new_indirect); Branch (148:17): [True: 16.3M, False: 18.4E]
| 149 | 16.3M | T* src = direct_ptr(0); | 150 | 16.3M | T* dst = reinterpret_cast<T*>(new_indirect); | 151 | 16.3M | memcpy(dst, src, size() * sizeof(T)); | 152 | 16.3M | _union.indirect_contents.indirect = new_indirect; | 153 | 16.3M | _union.indirect_contents.capacity = new_capacity; | 154 | 16.3M | _size += N + 1; | 155 | 16.3M | } | 156 | 17.7M | } | 157 | 631M | } |
_ZN9prevectorILj16EhjiE15change_capacityEj Line | Count | Source | 128 | 597M | void change_capacity(size_type new_capacity) { | 129 | 597M | if (new_capacity <= N) { Branch (129:13): [True: 418M, False: 179M]
| 130 | 418M | if (!is_direct()) { Branch (130:17): [True: 0, False: 418M]
| 131 | 0 | T* indirect = indirect_ptr(0); | 132 | 0 | T* src = indirect; | 133 | 0 | T* dst = direct_ptr(0); | 134 | 0 | memcpy(dst, src, size() * sizeof(T)); | 135 | 0 | free(indirect); | 136 | 0 | _size -= N + 1; | 137 | 0 | } | 138 | 418M | } else { | 139 | 179M | if (!is_direct()) { Branch (139:17): [True: 0, False: 179M]
| 140 | | /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert | 141 | | success. These should instead use an allocator or new/delete so that handlers | 142 | | are called as necessary, but performance would be slightly degraded by doing so. */ | 143 | 0 | _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity)); | 144 | 0 | assert(_union.indirect_contents.indirect); Branch (144:17): [True: 0, False: 0]
| 145 | 0 | _union.indirect_contents.capacity = new_capacity; | 146 | 179M | } else { | 147 | 179M | char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity)); | 148 | 179M | assert(new_indirect); Branch (148:17): [True: 179M, False: 0]
| 149 | 179M | T* src = direct_ptr(0); | 150 | 179M | T* dst = reinterpret_cast<T*>(new_indirect); | 151 | 179M | memcpy(dst, src, size() * sizeof(T)); | 152 | 179M | _union.indirect_contents.indirect = new_indirect; | 153 | 179M | _union.indirect_contents.capacity = new_capacity; | 154 | 179M | _size += N + 1; | 155 | 179M | } | 156 | 179M | } | 157 | 597M | } |
_ZN9prevectorILj33EhjiE15change_capacityEj Line | Count | Source | 128 | 1.00M | void change_capacity(size_type new_capacity) { | 129 | 1.00M | if (new_capacity <= N) { Branch (129:13): [True: 1.00M, False: 580]
| 130 | 1.00M | if (!is_direct()) { Branch (130:17): [True: 0, False: 1.00M]
| 131 | 0 | T* indirect = indirect_ptr(0); | 132 | 0 | T* src = indirect; | 133 | 0 | T* dst = direct_ptr(0); | 134 | 0 | memcpy(dst, src, size() * sizeof(T)); | 135 | 0 | free(indirect); | 136 | 0 | _size -= N + 1; | 137 | 0 | } | 138 | 1.00M | } else { | 139 | 580 | if (!is_direct()) { Branch (139:17): [True: 0, False: 580]
| 140 | | /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert | 141 | | success. These should instead use an allocator or new/delete so that handlers | 142 | | are called as necessary, but performance would be slightly degraded by doing so. */ | 143 | 0 | _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity)); | 144 | 0 | assert(_union.indirect_contents.indirect); Branch (144:17): [True: 0, False: 0]
| 145 | 0 | _union.indirect_contents.capacity = new_capacity; | 146 | 580 | } else { | 147 | 580 | char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity)); | 148 | 580 | assert(new_indirect); Branch (148:17): [True: 580, False: 0]
| 149 | 580 | T* src = direct_ptr(0); | 150 | 580 | T* dst = reinterpret_cast<T*>(new_indirect); | 151 | 580 | memcpy(dst, src, size() * sizeof(T)); | 152 | 580 | _union.indirect_contents.indirect = new_indirect; | 153 | 580 | _union.indirect_contents.capacity = new_capacity; | 154 | 580 | _size += N + 1; | 155 | 580 | } | 156 | 580 | } | 157 | 1.00M | } |
_ZN9prevectorILj8EijiE15change_capacityEj Line | Count | Source | 128 | 62.9k | void change_capacity(size_type new_capacity) { | 129 | 62.9k | if (new_capacity <= N) { Branch (129:13): [True: 14.9k, False: 47.9k]
| 130 | 14.9k | if (!is_direct()) { Branch (130:17): [True: 2.98k, False: 11.9k]
| 131 | 2.98k | T* indirect = indirect_ptr(0); | 132 | 2.98k | T* src = indirect; | 133 | 2.98k | T* dst = direct_ptr(0); | 134 | 2.98k | memcpy(dst, src, size() * sizeof(T)); | 135 | 2.98k | free(indirect); | 136 | 2.98k | _size -= N + 1; | 137 | 2.98k | } | 138 | 47.9k | } else { | 139 | 47.9k | if (!is_direct()) { Branch (139:17): [True: 28.1k, False: 19.8k]
| 140 | | /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert | 141 | | success. These should instead use an allocator or new/delete so that handlers | 142 | | are called as necessary, but performance would be slightly degraded by doing so. */ | 143 | 28.1k | _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity)); | 144 | 28.1k | assert(_union.indirect_contents.indirect); Branch (144:17): [True: 28.1k, False: 0]
| 145 | 28.1k | _union.indirect_contents.capacity = new_capacity; | 146 | 28.1k | } else { | 147 | 19.8k | char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity)); | 148 | 19.8k | assert(new_indirect); Branch (148:17): [True: 19.8k, False: 0]
| 149 | 19.8k | T* src = direct_ptr(0); | 150 | 19.8k | T* dst = reinterpret_cast<T*>(new_indirect); | 151 | 19.8k | memcpy(dst, src, size() * sizeof(T)); | 152 | 19.8k | _union.indirect_contents.indirect = new_indirect; | 153 | 19.8k | _union.indirect_contents.capacity = new_capacity; | 154 | 19.8k | _size += N + 1; | 155 | 19.8k | } | 156 | 47.9k | } | 157 | 62.9k | } |
_ZN9prevectorILj35EhjiE15change_capacityEj Line | Count | Source | 128 | 68.1k | void change_capacity(size_type new_capacity) { | 129 | 68.1k | if (new_capacity <= N) { Branch (129:13): [True: 68.1k, False: 0]
| 130 | 68.1k | if (!is_direct()) { Branch (130:17): [True: 0, False: 68.1k]
| 131 | 0 | T* indirect = indirect_ptr(0); | 132 | 0 | T* src = indirect; | 133 | 0 | T* dst = direct_ptr(0); | 134 | 0 | memcpy(dst, src, size() * sizeof(T)); | 135 | 0 | free(indirect); | 136 | 0 | _size -= N + 1; | 137 | 0 | } | 138 | 68.1k | } else { | 139 | 0 | if (!is_direct()) { Branch (139:17): [True: 0, False: 0]
| 140 | | /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert | 141 | | success. These should instead use an allocator or new/delete so that handlers | 142 | | are called as necessary, but performance would be slightly degraded by doing so. */ | 143 | 0 | _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity)); | 144 | 0 | assert(_union.indirect_contents.indirect); Branch (144:17): [True: 0, False: 0]
| 145 | 0 | _union.indirect_contents.capacity = new_capacity; | 146 | 0 | } else { | 147 | 0 | char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity)); | 148 | 0 | assert(new_indirect); Branch (148:17): [True: 0, False: 0]
| 149 | 0 | T* src = direct_ptr(0); | 150 | 0 | T* dst = reinterpret_cast<T*>(new_indirect); | 151 | 0 | memcpy(dst, src, size() * sizeof(T)); | 152 | 0 | _union.indirect_contents.indirect = new_indirect; | 153 | 0 | _union.indirect_contents.capacity = new_capacity; | 154 | 0 | _size += N + 1; | 155 | 0 | } | 156 | 0 | } | 157 | 68.1k | } |
Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiE15change_capacityEj |
158 | | |
159 | 2.19G | T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }_ZN9prevectorILj36EhjiE8item_ptrEi Line | Count | Source | 159 | 1.45G | T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (159:47): [True: 877M, False: 580M]
|
_ZN9prevectorILj33EhjiE8item_ptrEi Line | Count | Source | 159 | 4.16M | T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (159:47): [True: 4.16M, False: 580]
|
_ZN9prevectorILj16EhjiE8item_ptrEi Line | Count | Source | 159 | 726M | T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (159:47): [True: 532M, False: 194M]
|
_ZN9prevectorILj8EijiE8item_ptrEi Line | Count | Source | 159 | 778k | T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (159:47): [True: 245k, False: 533k]
|
_ZN9prevectorILj35EhjiE8item_ptrEi Line | Count | Source | 159 | 545k | T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (159:47): [True: 545k, False: 0]
|
Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiE8item_ptrEi Branch (159:47): [True: 877M, False: 580M]
Branch (159:47): [True: 4.16M, False: 580]
Branch (159:47): [True: 532M, False: 194M]
Branch (159:47): [True: 245k, False: 533k]
Branch (159:47): [True: 545k, False: 0]
Branch (159:47): [True: 0, False: 0]
|
160 | 10.2G | const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }_ZNK9prevectorILj36EhjiE8item_ptrEi Line | Count | Source | 160 | 5.10G | const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (160:59): [True: 3.86G, False: 1.24G]
|
_ZNK9prevectorILj16EhjiE8item_ptrEi Line | Count | Source | 160 | 5.15G | const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (160:59): [True: 4.45G, False: 703M]
|
_ZNK9prevectorILj8EijiE8item_ptrEi Line | Count | Source | 160 | 11.1M | const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (160:59): [True: 44.3k, False: 11.1M]
|
_ZNK9prevectorILj33EhjiE8item_ptrEi Line | Count | Source | 160 | 1.00M | const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } Branch (160:59): [True: 1.00M, False: 180]
|
Branch (160:59): [True: 3.86G, False: 1.24G]
Branch (160:59): [True: 4.45G, False: 703M]
Branch (160:59): [True: 44.3k, False: 11.1M]
Branch (160:59): [True: 1.00M, False: 180]
|
161 | | |
162 | 138M | void fill(T* dst, ptrdiff_t count, const T& value = T{}) { |
163 | 138M | std::fill_n(dst, count, value); |
164 | 138M | } _ZN9prevectorILj36EhjiE4fillEPhlRKh Line | Count | Source | 162 | 14.0M | void fill(T* dst, ptrdiff_t count, const T& value = T{}) { | 163 | 14.0M | std::fill_n(dst, count, value); | 164 | 14.0M | } |
_ZN9prevectorILj16EhjiE4fillEPhlRKh Line | Count | Source | 162 | 123M | void fill(T* dst, ptrdiff_t count, const T& value = T{}) { | 163 | 123M | std::fill_n(dst, count, value); | 164 | 123M | } |
_ZN9prevectorILj33EhjiE4fillEPhlRKh Line | Count | Source | 162 | 1.54M | void fill(T* dst, ptrdiff_t count, const T& value = T{}) { | 163 | 1.54M | std::fill_n(dst, count, value); | 164 | 1.54M | } |
_ZN9prevectorILj8EijiE4fillEPilRKi Line | Count | Source | 162 | 74.4k | void fill(T* dst, ptrdiff_t count, const T& value = T{}) { | 163 | 74.4k | std::fill_n(dst, count, value); | 164 | 74.4k | } |
|
165 | | |
166 | | template <std::input_iterator InputIterator> |
167 | 1.35G | void fill(T* dst, InputIterator first, InputIterator last) { |
168 | 55.5G | while (first != last) { Branch (168:16): [True: 15.0M, False: 66.5k]
Branch (168:16): [True: 6.08G, False: 41.6M]
Branch (168:16): [True: 36.4G, False: 804M]
Branch (168:16): [True: 9.62G, False: 485M]
Branch (168:16): [True: 40.5M, False: 6.82M]
Branch (168:16): [True: 967M, False: 1.97M]
Branch (168:16): [True: 48.9k, False: 21.9k]
Branch (168:16): [True: 120M, False: 34.9k]
Branch (168:16): [True: 1.58M, False: 417]
Branch (168:16): [True: 659k, False: 2.85k]
Branch (168:16): [True: 859M, False: 9.25M]
Branch (168:16): [True: 17.5M, False: 1.09M]
Branch (168:16): [True: 26.3M, False: 2.63M]
Branch (168:16): [True: 524k, False: 16.3k]
Branch (168:16): [True: 199k, False: 49.8k]
Branch (168:16): [True: 2.18M, False: 68.1k]
Branch (168:16): [True: 136k, False: 68.1k]
Branch (168:16): [True: 68.1k, False: 68.1k]
|
169 | 54.1G | new(static_cast<void*>(dst)) T(*first); |
170 | 54.1G | ++dst; |
171 | 54.1G | ++first; |
172 | 54.1G | } |
173 | 1.35G | } _ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorPKhEEvPhT_S5_ Line | Count | Source | 167 | 66.5k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 15.1M | while (first != last) { Branch (168:16): [True: 15.0M, False: 66.5k]
| 169 | 15.0M | new(static_cast<void*>(dst)) T(*first); | 170 | 15.0M | ++dst; | 171 | 15.0M | ++first; | 172 | 15.0M | } | 173 | 66.5k | } |
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvPhT_SA_ Line | Count | Source | 167 | 41.6M | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 6.12G | while (first != last) { Branch (168:16): [True: 6.08G, False: 41.6M]
| 169 | 6.08G | new(static_cast<void*>(dst)) T(*first); | 170 | 6.08G | ++dst; | 171 | 6.08G | ++first; | 172 | 6.08G | } | 173 | 41.6M | } |
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorNS0_14const_iteratorEEEvPhT_S4_ Line | Count | Source | 167 | 804M | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 37.2G | while (first != last) { Branch (168:16): [True: 36.4G, False: 804M]
| 169 | 36.4G | new(static_cast<void*>(dst)) T(*first); | 170 | 36.4G | ++dst; | 171 | 36.4G | ++first; | 172 | 36.4G | } | 173 | 804M | } |
_ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorNS0_14const_iteratorEEEvPhT_S4_ Line | Count | Source | 167 | 485M | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 10.1G | while (first != last) { Branch (168:16): [True: 9.62G, False: 485M]
| 169 | 9.62G | new(static_cast<void*>(dst)) T(*first); | 170 | 9.62G | ++dst; | 171 | 9.62G | ++first; | 172 | 9.62G | } | 173 | 485M | } |
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEvPhT_SB_ Line | Count | Source | 167 | 6.82M | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 47.4M | while (first != last) { Branch (168:16): [True: 40.5M, False: 6.82M]
| 169 | 40.5M | new(static_cast<void*>(dst)) T(*first); | 170 | 40.5M | ++dst; | 171 | 40.5M | ++first; | 172 | 40.5M | } | 173 | 6.82M | } |
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorNS0_8iteratorEEEvPhT_S4_ Line | Count | Source | 167 | 1.97M | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 969M | while (first != last) { Branch (168:16): [True: 967M, False: 1.97M]
| 169 | 967M | new(static_cast<void*>(dst)) T(*first); | 170 | 967M | ++dst; | 171 | 967M | ++first; | 172 | 967M | } | 173 | 1.97M | } |
_ZN9prevectorILj8EijiE4fillITkSt14input_iteratorPiEEvS2_T_S3_ Line | Count | Source | 167 | 21.9k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 70.9k | while (first != last) { Branch (168:16): [True: 48.9k, False: 21.9k]
| 169 | 48.9k | new(static_cast<void*>(dst)) T(*first); | 170 | 48.9k | ++dst; | 171 | 48.9k | ++first; | 172 | 48.9k | } | 173 | 21.9k | } |
_ZN9prevectorILj8EijiE4fillITkSt14input_iteratorNS0_14const_iteratorEEEvPiT_S4_ Line | Count | Source | 167 | 34.9k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 120M | while (first != last) { Branch (168:16): [True: 120M, False: 34.9k]
| 169 | 120M | new(static_cast<void*>(dst)) T(*first); | 170 | 120M | ++dst; | 171 | 120M | ++first; | 172 | 120M | } | 173 | 34.9k | } |
_ZN9prevectorILj8EijiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEEEEvPiT_SB_ Line | Count | Source | 167 | 417 | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 1.58M | while (first != last) { Branch (168:16): [True: 1.58M, False: 417]
| 169 | 1.58M | new(static_cast<void*>(dst)) T(*first); | 170 | 1.58M | ++dst; | 171 | 1.58M | ++first; | 172 | 1.58M | } | 173 | 417 | } |
_ZN9prevectorILj33EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEvPhT_SB_ Line | Count | Source | 167 | 2.85k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 662k | while (first != last) { Branch (168:16): [True: 659k, False: 2.85k]
| 169 | 659k | new(static_cast<void*>(dst)) T(*first); | 170 | 659k | ++dst; | 171 | 659k | ++first; | 172 | 659k | } | 173 | 2.85k | } |
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEEvS4_T_S9_ Line | Count | Source | 167 | 9.25M | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 868M | while (first != last) { Branch (168:16): [True: 859M, False: 9.25M]
| 169 | 859M | new(static_cast<void*>(dst)) T(*first); | 170 | 859M | ++dst; | 171 | 859M | ++first; | 172 | 859M | } | 173 | 9.25M | } |
_ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvPhT_SA_ Line | Count | Source | 167 | 1.09M | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 18.6M | while (first != last) { Branch (168:16): [True: 17.5M, False: 1.09M]
| 169 | 17.5M | new(static_cast<void*>(dst)) T(*first); | 170 | 17.5M | ++dst; | 171 | 17.5M | ++first; | 172 | 17.5M | } | 173 | 1.09M | } |
_ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorPhEEvS2_T_S3_ Line | Count | Source | 167 | 2.63M | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 29.0M | while (first != last) { Branch (168:16): [True: 26.3M, False: 2.63M]
| 169 | 26.3M | new(static_cast<void*>(dst)) T(*first); | 170 | 26.3M | ++dst; | 171 | 26.3M | ++first; | 172 | 26.3M | } | 173 | 2.63M | } |
_ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEEvS4_T_S9_ Line | Count | Source | 167 | 16.3k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 540k | while (first != last) { Branch (168:16): [True: 524k, False: 16.3k]
| 169 | 524k | new(static_cast<void*>(dst)) T(*first); | 170 | 524k | ++dst; | 171 | 524k | ++first; | 172 | 524k | } | 173 | 16.3k | } |
_ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorPKhEEvPhT_S5_ Line | Count | Source | 167 | 49.8k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 249k | while (first != last) { Branch (168:16): [True: 199k, False: 49.8k]
| 169 | 199k | new(static_cast<void*>(dst)) T(*first); | 170 | 199k | ++dst; | 171 | 199k | ++first; | 172 | 199k | } | 173 | 49.8k | } |
_ZN9prevectorILj35EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvPhT_SA_ Line | Count | Source | 167 | 68.1k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 2.25M | while (first != last) { Branch (168:16): [True: 2.18M, False: 68.1k]
| 169 | 2.18M | new(static_cast<void*>(dst)) T(*first); | 170 | 2.18M | ++dst; | 171 | 2.18M | ++first; | 172 | 2.18M | } | 173 | 68.1k | } |
_ZN9prevectorILj35EhjiE4fillITkSt14input_iteratorPhEEvS2_T_S3_ Line | Count | Source | 167 | 68.1k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 204k | while (first != last) { Branch (168:16): [True: 136k, False: 68.1k]
| 169 | 136k | new(static_cast<void*>(dst)) T(*first); | 170 | 136k | ++dst; | 171 | 136k | ++first; | 172 | 136k | } | 173 | 68.1k | } |
_ZN9prevectorILj35EhjiE4fillITkSt14input_iteratorPKhEEvPhT_S5_ Line | Count | Source | 167 | 68.1k | void fill(T* dst, InputIterator first, InputIterator last) { | 168 | 136k | while (first != last) { Branch (168:16): [True: 68.1k, False: 68.1k]
| 169 | 68.1k | new(static_cast<void*>(dst)) T(*first); | 170 | 68.1k | ++dst; | 171 | 68.1k | ++first; | 172 | 68.1k | } | 173 | 68.1k | } |
|
174 | | |
175 | | public: |
176 | 1.13M | void assign(size_type n, const T& val) { |
177 | 1.13M | clear(); |
178 | 1.13M | if (capacity() < n) { Branch (178:13): [True: 0, False: 1.10M]
Branch (178:13): [True: 9.90k, False: 18.9k]
|
179 | 9.90k | change_capacity(n); |
180 | 9.90k | } |
181 | 1.13M | _size += n; |
182 | 1.13M | fill(item_ptr(0), n, val); |
183 | 1.13M | } _ZN9prevectorILj16EhjiE6assignEjRKh Line | Count | Source | 176 | 1.10M | void assign(size_type n, const T& val) { | 177 | 1.10M | clear(); | 178 | 1.10M | if (capacity() < n) { Branch (178:13): [True: 0, False: 1.10M]
| 179 | 0 | change_capacity(n); | 180 | 0 | } | 181 | 1.10M | _size += n; | 182 | 1.10M | fill(item_ptr(0), n, val); | 183 | 1.10M | } |
_ZN9prevectorILj8EijiE6assignEjRKi Line | Count | Source | 176 | 28.8k | void assign(size_type n, const T& val) { | 177 | 28.8k | clear(); | 178 | 28.8k | if (capacity() < n) { Branch (178:13): [True: 9.90k, False: 18.9k]
| 179 | 9.90k | change_capacity(n); | 180 | 9.90k | } | 181 | 28.8k | _size += n; | 182 | 28.8k | fill(item_ptr(0), n, val); | 183 | 28.8k | } |
|
184 | | |
185 | | template <std::input_iterator InputIterator> |
186 | 229M | void assign(InputIterator first, InputIterator last) { |
187 | 229M | size_type n = last - first; |
188 | 229M | clear(); |
189 | 229M | if (capacity() < n) { Branch (189:13): [True: 3.88M, False: 9.67M]
Branch (189:13): [True: 921k, False: 211M]
Branch (189:13): [True: 3.89k, False: 30.6k]
Branch (189:13): [True: 580, False: 2.27k]
Branch (189:13): [True: 6.09k, False: 1.09M]
Branch (189:13): [True: 0, False: 2.63M]
Branch (189:13): [True: 16.3k, False: 0]
Branch (189:13): [True: 0, False: 49.8k]
|
190 | 4.83M | change_capacity(n); |
191 | 4.83M | } |
192 | 229M | _size += n; |
193 | 229M | fill(item_ptr(0), first, last); |
194 | 229M | } _ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorNS0_14const_iteratorEEEvT_S3_ Line | Count | Source | 186 | 13.5M | void assign(InputIterator first, InputIterator last) { | 187 | 13.5M | size_type n = last - first; | 188 | 13.5M | clear(); | 189 | 13.5M | if (capacity() < n) { Branch (189:13): [True: 3.88M, False: 9.67M]
| 190 | 3.88M | change_capacity(n); | 191 | 3.88M | } | 192 | 13.5M | _size += n; | 193 | 13.5M | fill(item_ptr(0), first, last); | 194 | 13.5M | } |
_ZN9prevectorILj36EhjiE6assignITkSt14input_iteratorNS0_14const_iteratorEEEvT_S3_ Line | Count | Source | 186 | 212M | void assign(InputIterator first, InputIterator last) { | 187 | 212M | size_type n = last - first; | 188 | 212M | clear(); | 189 | 212M | if (capacity() < n) { Branch (189:13): [True: 921k, False: 211M]
| 190 | 921k | change_capacity(n); | 191 | 921k | } | 192 | 212M | _size += n; | 193 | 212M | fill(item_ptr(0), first, last); | 194 | 212M | } |
_ZN9prevectorILj8EijiE6assignITkSt14input_iteratorNS0_14const_iteratorEEEvT_S3_ Line | Count | Source | 186 | 34.5k | void assign(InputIterator first, InputIterator last) { | 187 | 34.5k | size_type n = last - first; | 188 | 34.5k | clear(); | 189 | 34.5k | if (capacity() < n) { Branch (189:13): [True: 3.89k, False: 30.6k]
| 190 | 3.89k | change_capacity(n); | 191 | 3.89k | } | 192 | 34.5k | _size += n; | 193 | 34.5k | fill(item_ptr(0), first, last); | 194 | 34.5k | } |
_ZN9prevectorILj33EhjiE6assignITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEvT_SA_ Line | Count | Source | 186 | 2.85k | void assign(InputIterator first, InputIterator last) { | 187 | 2.85k | size_type n = last - first; | 188 | 2.85k | clear(); | 189 | 2.85k | if (capacity() < n) { Branch (189:13): [True: 580, False: 2.27k]
| 190 | 580 | change_capacity(n); | 191 | 580 | } | 192 | 2.85k | _size += n; | 193 | 2.85k | fill(item_ptr(0), first, last); | 194 | 2.85k | } |
_ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvT_S9_ Line | Count | Source | 186 | 1.09M | void assign(InputIterator first, InputIterator last) { | 187 | 1.09M | size_type n = last - first; | 188 | 1.09M | clear(); | 189 | 1.09M | if (capacity() < n) { Branch (189:13): [True: 6.09k, False: 1.09M]
| 190 | 6.09k | change_capacity(n); | 191 | 6.09k | } | 192 | 1.09M | _size += n; | 193 | 1.09M | fill(item_ptr(0), first, last); | 194 | 1.09M | } |
_ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorPhEEvT_S3_ Line | Count | Source | 186 | 2.63M | void assign(InputIterator first, InputIterator last) { | 187 | 2.63M | size_type n = last - first; | 188 | 2.63M | clear(); | 189 | 2.63M | if (capacity() < n) { Branch (189:13): [True: 0, False: 2.63M]
| 190 | 0 | change_capacity(n); | 191 | 0 | } | 192 | 2.63M | _size += n; | 193 | 2.63M | fill(item_ptr(0), first, last); | 194 | 2.63M | } |
_ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEEvT_S9_ Line | Count | Source | 186 | 16.3k | void assign(InputIterator first, InputIterator last) { | 187 | 16.3k | size_type n = last - first; | 188 | 16.3k | clear(); | 189 | 16.3k | if (capacity() < n) { Branch (189:13): [True: 16.3k, False: 0]
| 190 | 16.3k | change_capacity(n); | 191 | 16.3k | } | 192 | 16.3k | _size += n; | 193 | 16.3k | fill(item_ptr(0), first, last); | 194 | 16.3k | } |
_ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorPKhEEvT_S4_ Line | Count | Source | 186 | 49.8k | void assign(InputIterator first, InputIterator last) { | 187 | 49.8k | size_type n = last - first; | 188 | 49.8k | clear(); | 189 | 49.8k | if (capacity() < n) { Branch (189:13): [True: 0, False: 49.8k]
| 190 | 0 | change_capacity(n); | 191 | 0 | } | 192 | 49.8k | _size += n; | 193 | 49.8k | fill(item_ptr(0), first, last); | 194 | 49.8k | } |
|
195 | | |
196 | 428M | prevector() = default; _ZN9prevectorILj36EhjiEC2Ev Line | Count | Source | 196 | 422M | prevector() = default; |
_ZN9prevectorILj33EhjiEC2Ev Line | Count | Source | 196 | 6.31M | prevector() = default; |
_ZN9prevectorILj8EijiEC2Ev Line | Count | Source | 196 | 834 | prevector() = default; |
Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiEC2Ev |
197 | | |
198 | | explicit prevector(size_type n) { |
199 | | resize(n); |
200 | | } |
201 | | |
202 | 108M | explicit prevector(size_type n, const T& val) { |
203 | 108M | change_capacity(n); |
204 | 108M | _size += n; |
205 | 108M | fill(item_ptr(0), n, val); |
206 | 108M | } _ZN9prevectorILj33EhjiEC2EjRKh Line | Count | Source | 202 | 1.00M | explicit prevector(size_type n, const T& val) { | 203 | 1.00M | change_capacity(n); | 204 | 1.00M | _size += n; | 205 | 1.00M | fill(item_ptr(0), n, val); | 206 | 1.00M | } |
_ZN9prevectorILj16EhjiEC2EjRKh Line | Count | Source | 202 | 107M | explicit prevector(size_type n, const T& val) { | 203 | 107M | change_capacity(n); | 204 | 107M | _size += n; | 205 | 107M | fill(item_ptr(0), n, val); | 206 | 107M | } |
|
207 | | |
208 | | template <std::input_iterator InputIterator> |
209 | 7.65M | prevector(InputIterator first, InputIterator last) { |
210 | 7.65M | size_type n = last - first; |
211 | 7.65M | change_capacity(n); |
212 | 7.65M | _size += n; |
213 | 7.65M | fill(item_ptr(0), first, last); |
214 | 7.65M | } _ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEET_SA_ Line | Count | Source | 209 | 6.82M | prevector(InputIterator first, InputIterator last) { | 210 | 6.82M | size_type n = last - first; | 211 | 6.82M | change_capacity(n); | 212 | 6.82M | _size += n; | 213 | 6.82M | fill(item_ptr(0), first, last); | 214 | 6.82M | } |
_ZN9prevectorILj8EijiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEEEET_SA_ Line | Count | Source | 209 | 417 | prevector(InputIterator first, InputIterator last) { | 210 | 417 | size_type n = last - first; | 211 | 417 | change_capacity(n); | 212 | 417 | _size += n; | 213 | 417 | fill(item_ptr(0), first, last); | 214 | 417 | } |
_ZN9prevectorILj8EijiEC2ITkSt14input_iteratorNS0_14const_iteratorEEET_S3_ Line | Count | Source | 209 | 417 | prevector(InputIterator first, InputIterator last) { | 210 | 417 | size_type n = last - first; | 211 | 417 | change_capacity(n); | 212 | 417 | _size += n; | 213 | 417 | fill(item_ptr(0), first, last); | 214 | 417 | } |
_ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEET_S9_ Line | Count | Source | 209 | 121k | prevector(InputIterator first, InputIterator last) { | 210 | 121k | size_type n = last - first; | 211 | 121k | change_capacity(n); | 212 | 121k | _size += n; | 213 | 121k | fill(item_ptr(0), first, last); | 214 | 121k | } |
_ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorPKhEET_S4_ Line | Count | Source | 209 | 4.12k | prevector(InputIterator first, InputIterator last) { | 210 | 4.12k | size_type n = last - first; | 211 | 4.12k | change_capacity(n); | 212 | 4.12k | _size += n; | 213 | 4.12k | fill(item_ptr(0), first, last); | 214 | 4.12k | } |
_ZN9prevectorILj35EhjiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEET_S9_ Line | Count | Source | 209 | 68.1k | prevector(InputIterator first, InputIterator last) { | 210 | 68.1k | size_type n = last - first; | 211 | 68.1k | change_capacity(n); | 212 | 68.1k | _size += n; | 213 | 68.1k | fill(item_ptr(0), first, last); | 214 | 68.1k | } |
_ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEET_S9_ Line | Count | Source | 209 | 4.30k | prevector(InputIterator first, InputIterator last) { | 210 | 4.30k | size_type n = last - first; | 211 | 4.30k | change_capacity(n); | 212 | 4.30k | _size += n; | 213 | 4.30k | fill(item_ptr(0), first, last); | 214 | 4.30k | } |
_ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorNS0_14const_iteratorEEET_S3_ Line | Count | Source | 209 | 625k | prevector(InputIterator first, InputIterator last) { | 210 | 625k | size_type n = last - first; | 211 | 625k | change_capacity(n); | 212 | 625k | _size += n; | 213 | 625k | fill(item_ptr(0), first, last); | 214 | 625k | } |
|
215 | | |
216 | 983M | prevector(const prevector<N, T, Size, Diff>& other) { |
217 | 983M | size_type n = other.size(); |
218 | 983M | change_capacity(n); |
219 | 983M | _size += n; |
220 | 983M | fill(item_ptr(0), other.begin(), other.end()); |
221 | 983M | } _ZN9prevectorILj16EhjiEC2ERKS0_ Line | Count | Source | 216 | 471M | prevector(const prevector<N, T, Size, Diff>& other) { | 217 | 471M | size_type n = other.size(); | 218 | 471M | change_capacity(n); | 219 | 471M | _size += n; | 220 | 471M | fill(item_ptr(0), other.begin(), other.end()); | 221 | 471M | } |
_ZN9prevectorILj36EhjiEC2ERKS0_ Line | Count | Source | 216 | 511M | prevector(const prevector<N, T, Size, Diff>& other) { | 217 | 511M | size_type n = other.size(); | 218 | 511M | change_capacity(n); | 219 | 511M | _size += n; | 220 | 511M | fill(item_ptr(0), other.begin(), other.end()); | 221 | 511M | } |
|
222 | | |
223 | | prevector(prevector<N, T, Size, Diff>&& other) noexcept |
224 | 368M | : _union(std::move(other._union)), _size(other._size) |
225 | 368M | { |
226 | 368M | other._size = 0; |
227 | 368M | } _ZN9prevectorILj16EhjiEC2EOS0_ Line | Count | Source | 224 | 16.1M | : _union(std::move(other._union)), _size(other._size) | 225 | 16.1M | { | 226 | 16.1M | other._size = 0; | 227 | 16.1M | } |
_ZN9prevectorILj36EhjiEC2EOS0_ Line | Count | Source | 224 | 352M | : _union(std::move(other._union)), _size(other._size) | 225 | 352M | { | 226 | 352M | other._size = 0; | 227 | 352M | } |
|
228 | | |
229 | 225M | prevector& operator=(const prevector<N, T, Size, Diff>& other) { |
230 | 225M | if (&other == this) { Branch (230:13): [True: 0, False: 13.5M]
Branch (230:13): [True: 0, False: 212M]
Branch (230:13): [True: 0, False: 34.5k]
|
231 | 0 | return *this; |
232 | 0 | } |
233 | 225M | assign(other.begin(), other.end()); |
234 | 225M | return *this; |
235 | 225M | } _ZN9prevectorILj16EhjiEaSERKS0_ Line | Count | Source | 229 | 13.5M | prevector& operator=(const prevector<N, T, Size, Diff>& other) { | 230 | 13.5M | if (&other == this) { Branch (230:13): [True: 0, False: 13.5M]
| 231 | 0 | return *this; | 232 | 0 | } | 233 | 13.5M | assign(other.begin(), other.end()); | 234 | 13.5M | return *this; | 235 | 13.5M | } |
_ZN9prevectorILj36EhjiEaSERKS0_ Line | Count | Source | 229 | 212M | prevector& operator=(const prevector<N, T, Size, Diff>& other) { | 230 | 212M | if (&other == this) { Branch (230:13): [True: 0, False: 212M]
| 231 | 0 | return *this; | 232 | 0 | } | 233 | 212M | assign(other.begin(), other.end()); | 234 | 212M | return *this; | 235 | 212M | } |
_ZN9prevectorILj8EijiEaSERKS0_ Line | Count | Source | 229 | 34.5k | prevector& operator=(const prevector<N, T, Size, Diff>& other) { | 230 | 34.5k | if (&other == this) { Branch (230:13): [True: 0, False: 34.5k]
| 231 | 0 | return *this; | 232 | 0 | } | 233 | 34.5k | assign(other.begin(), other.end()); | 234 | 34.5k | return *this; | 235 | 34.5k | } |
|
236 | | |
237 | 91.0M | prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept { |
238 | 91.0M | if (!is_direct()) { Branch (238:13): [True: 369k, False: 34.9M]
Branch (238:13): [True: 481k, False: 55.2M]
Branch (238:13): [True: 16.0k, False: 16.7k]
|
239 | 866k | free(_union.indirect_contents.indirect); |
240 | 866k | } |
241 | 91.0M | _union = std::move(other._union); |
242 | 91.0M | _size = other._size; |
243 | 91.0M | other._size = 0; |
244 | 91.0M | return *this; |
245 | 91.0M | } _ZN9prevectorILj36EhjiEaSEOS0_ Line | Count | Source | 237 | 35.2M | prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept { | 238 | 35.2M | if (!is_direct()) { Branch (238:13): [True: 369k, False: 34.9M]
| 239 | 369k | free(_union.indirect_contents.indirect); | 240 | 369k | } | 241 | 35.2M | _union = std::move(other._union); | 242 | 35.2M | _size = other._size; | 243 | 35.2M | other._size = 0; | 244 | 35.2M | return *this; | 245 | 35.2M | } |
_ZN9prevectorILj16EhjiEaSEOS0_ Line | Count | Source | 237 | 55.7M | prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept { | 238 | 55.7M | if (!is_direct()) { Branch (238:13): [True: 481k, False: 55.2M]
| 239 | 481k | free(_union.indirect_contents.indirect); | 240 | 481k | } | 241 | 55.7M | _union = std::move(other._union); | 242 | 55.7M | _size = other._size; | 243 | 55.7M | other._size = 0; | 244 | 55.7M | return *this; | 245 | 55.7M | } |
_ZN9prevectorILj8EijiEaSEOS0_ Line | Count | Source | 237 | 32.7k | prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept { | 238 | 32.7k | if (!is_direct()) { Branch (238:13): [True: 16.0k, False: 16.7k]
| 239 | 16.0k | free(_union.indirect_contents.indirect); | 240 | 16.0k | } | 241 | 32.7k | _union = std::move(other._union); | 242 | 32.7k | _size = other._size; | 243 | 32.7k | other._size = 0; | 244 | 32.7k | return *this; | 245 | 32.7k | } |
|
246 | | |
247 | 29.1G | size_type size() const { |
248 | 29.1G | return is_direct() ? _size : _size - N - 1; Branch (248:16): [True: 23.0G, False: 2.19G]
Branch (248:16): [True: 2.08M, False: 580]
Branch (248:16): [True: 3.28G, False: 689M]
Branch (248:16): [True: 297k, False: 1.97M]
Branch (248:16): [True: 477k, False: 0]
Branch (248:16): [True: 0, False: 0]
|
249 | 29.1G | } _ZNK9prevectorILj36EhjiE4sizeEv Line | Count | Source | 247 | 25.1G | size_type size() const { | 248 | 25.1G | return is_direct() ? _size : _size - N - 1; Branch (248:16): [True: 23.0G, False: 2.19G]
| 249 | 25.1G | } |
_ZNK9prevectorILj33EhjiE4sizeEv Line | Count | Source | 247 | 2.08M | size_type size() const { | 248 | 2.08M | return is_direct() ? _size : _size - N - 1; Branch (248:16): [True: 2.08M, False: 580]
| 249 | 2.08M | } |
_ZNK9prevectorILj16EhjiE4sizeEv Line | Count | Source | 247 | 3.97G | size_type size() const { | 248 | 3.97G | return is_direct() ? _size : _size - N - 1; Branch (248:16): [True: 3.28G, False: 689M]
| 249 | 3.97G | } |
_ZNK9prevectorILj8EijiE4sizeEv Line | Count | Source | 247 | 2.27M | size_type size() const { | 248 | 2.27M | return is_direct() ? _size : _size - N - 1; Branch (248:16): [True: 297k, False: 1.97M]
| 249 | 2.27M | } |
_ZNK9prevectorILj35EhjiE4sizeEv Line | Count | Source | 247 | 477k | size_type size() const { | 248 | 477k | return is_direct() ? _size : _size - N - 1; Branch (248:16): [True: 477k, False: 0]
| 249 | 477k | } |
Unexecuted instantiation: _ZNK9prevectorILj4E7NetworkjiE4sizeEv |
250 | | |
251 | 9.55G | bool empty() const { |
252 | 9.55G | return size() == 0; |
253 | 9.55G | } _ZNK9prevectorILj36EhjiE5emptyEv Line | Count | Source | 251 | 9.53G | bool empty() const { | 252 | 9.53G | return size() == 0; | 253 | 9.53G | } |
_ZNK9prevectorILj16EhjiE5emptyEv Line | Count | Source | 251 | 21.5M | bool empty() const { | 252 | 21.5M | return size() == 0; | 253 | 21.5M | } |
_ZNK9prevectorILj8EijiE5emptyEv Line | Count | Source | 251 | 417 | bool empty() const { | 252 | 417 | return size() == 0; | 253 | 417 | } |
Unexecuted instantiation: _ZNK9prevectorILj4E7NetworkjiE5emptyEv |
254 | | |
255 | 221M | iterator begin() { return iterator(item_ptr(0)); }_ZN9prevectorILj33EhjiE5beginEv Line | Count | Source | 255 | 22 | iterator begin() { return iterator(item_ptr(0)); } |
_ZN9prevectorILj36EhjiE5beginEv Line | Count | Source | 255 | 221M | iterator begin() { return iterator(item_ptr(0)); } |
Unexecuted instantiation: _ZN9prevectorILj16EhjiE5beginEv _ZN9prevectorILj8EijiE5beginEv Line | Count | Source | 255 | 230k | iterator begin() { return iterator(item_ptr(0)); } |
_ZN9prevectorILj35EhjiE5beginEv Line | Count | Source | 255 | 136k | iterator begin() { return iterator(item_ptr(0)); } |
|
256 | 3.63G | const_iterator begin() const { return const_iterator(item_ptr(0)); }_ZNK9prevectorILj36EhjiE5beginEv Line | Count | Source | 256 | 1.20G | const_iterator begin() const { return const_iterator(item_ptr(0)); } |
_ZNK9prevectorILj16EhjiE5beginEv Line | Count | Source | 256 | 2.42G | const_iterator begin() const { return const_iterator(item_ptr(0)); } |
_ZNK9prevectorILj8EijiE5beginEv Line | Count | Source | 256 | 3.20M | const_iterator begin() const { return const_iterator(item_ptr(0)); } |
|
257 | 273M | iterator end() { return iterator(item_ptr(size())); }_ZN9prevectorILj36EhjiE3endEv Line | Count | Source | 257 | 223M | iterator end() { return iterator(item_ptr(size())); } |
_ZN9prevectorILj33EhjiE3endEv Line | Count | Source | 257 | 22 | iterator end() { return iterator(item_ptr(size())); } |
_ZN9prevectorILj16EhjiE3endEv Line | Count | Source | 257 | 49.4M | iterator end() { return iterator(item_ptr(size())); } |
_ZN9prevectorILj8EijiE3endEv Line | Count | Source | 257 | 194k | iterator end() { return iterator(item_ptr(size())); } |
_ZN9prevectorILj35EhjiE3endEv Line | Count | Source | 257 | 136k | iterator end() { return iterator(item_ptr(size())); } |
|
258 | 2.93G | const_iterator end() const { return const_iterator(item_ptr(size())); }_ZNK9prevectorILj36EhjiE3endEv Line | Count | Source | 258 | 2.11G | const_iterator end() const { return const_iterator(item_ptr(size())); } |
_ZNK9prevectorILj16EhjiE3endEv Line | Count | Source | 258 | 819M | const_iterator end() const { return const_iterator(item_ptr(size())); } |
_ZNK9prevectorILj8EijiE3endEv Line | Count | Source | 258 | 1.62M | const_iterator end() const { return const_iterator(item_ptr(size())); } |
|
259 | | |
260 | 490M | size_t capacity() const { |
261 | 490M | if (is_direct()) { Branch (261:13): [True: 271M, False: 185M]
Branch (261:13): [True: 32.8M, False: 49.7k]
Branch (261:13): [True: 91.7k, False: 133k]
Branch (261:13): [True: 538k, False: 0]
Branch (261:13): [True: 136k, False: 0]
Branch (261:13): [True: 0, False: 0]
|
262 | 304M | return N; |
263 | 304M | } else { |
264 | 185M | return _union.indirect_contents.capacity; |
265 | 185M | } |
266 | 490M | } _ZNK9prevectorILj36EhjiE8capacityEv Line | Count | Source | 260 | 456M | size_t capacity() const { | 261 | 456M | if (is_direct()) { Branch (261:13): [True: 271M, False: 185M]
| 262 | 271M | return N; | 263 | 271M | } else { | 264 | 185M | return _union.indirect_contents.capacity; | 265 | 185M | } | 266 | 456M | } |
_ZNK9prevectorILj16EhjiE8capacityEv Line | Count | Source | 260 | 32.9M | size_t capacity() const { | 261 | 32.9M | if (is_direct()) { Branch (261:13): [True: 32.8M, False: 49.7k]
| 262 | 32.8M | return N; | 263 | 32.8M | } else { | 264 | 49.7k | return _union.indirect_contents.capacity; | 265 | 49.7k | } | 266 | 32.9M | } |
_ZNK9prevectorILj8EijiE8capacityEv Line | Count | Source | 260 | 225k | size_t capacity() const { | 261 | 225k | if (is_direct()) { Branch (261:13): [True: 91.7k, False: 133k]
| 262 | 91.7k | return N; | 263 | 133k | } else { | 264 | 133k | return _union.indirect_contents.capacity; | 265 | 133k | } | 266 | 225k | } |
_ZNK9prevectorILj33EhjiE8capacityEv Line | Count | Source | 260 | 538k | size_t capacity() const { | 261 | 538k | if (is_direct()) { Branch (261:13): [True: 538k, False: 0]
| 262 | 538k | return N; | 263 | 538k | } else { | 264 | 0 | return _union.indirect_contents.capacity; | 265 | 0 | } | 266 | 538k | } |
_ZNK9prevectorILj35EhjiE8capacityEv Line | Count | Source | 260 | 136k | size_t capacity() const { | 261 | 136k | if (is_direct()) { Branch (261:13): [True: 136k, False: 0]
| 262 | 136k | return N; | 263 | 136k | } else { | 264 | 0 | return _union.indirect_contents.capacity; | 265 | 0 | } | 266 | 136k | } |
Unexecuted instantiation: _ZNK9prevectorILj4E7NetworkjiE8capacityEv |
267 | | |
268 | 25.0M | T& operator[](size_type pos) { |
269 | 25.0M | return *item_ptr(pos); |
270 | 25.0M | } _ZN9prevectorILj36EhjiEixEj Line | Count | Source | 268 | 23.2M | T& operator[](size_type pos) { | 269 | 23.2M | return *item_ptr(pos); | 270 | 23.2M | } |
_ZN9prevectorILj8EijiEixEj Line | Count | Source | 268 | 72.0k | T& operator[](size_type pos) { | 269 | 72.0k | return *item_ptr(pos); | 270 | 72.0k | } |
_ZN9prevectorILj33EhjiEixEj Line | Count | Source | 268 | 1.07M | T& operator[](size_type pos) { | 269 | 1.07M | return *item_ptr(pos); | 270 | 1.07M | } |
_ZN9prevectorILj16EhjiEixEj Line | Count | Source | 268 | 604k | T& operator[](size_type pos) { | 269 | 604k | return *item_ptr(pos); | 270 | 604k | } |
Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiEixEj |
271 | | |
272 | 1.59G | const T& operator[](size_type pos) const { |
273 | 1.59G | return *item_ptr(pos); |
274 | 1.59G | } _ZNK9prevectorILj36EhjiEixEj Line | Count | Source | 272 | 481M | const T& operator[](size_type pos) const { | 273 | 481M | return *item_ptr(pos); | 274 | 481M | } |
_ZNK9prevectorILj16EhjiEixEj Line | Count | Source | 272 | 1.10G | const T& operator[](size_type pos) const { | 273 | 1.10G | return *item_ptr(pos); | 274 | 1.10G | } |
_ZNK9prevectorILj8EijiEixEj Line | Count | Source | 272 | 6.32M | const T& operator[](size_type pos) const { | 273 | 6.32M | return *item_ptr(pos); | 274 | 6.32M | } |
|
275 | | |
276 | 427M | void resize(size_type new_size) { |
277 | 427M | size_type cur_size = size(); |
278 | 427M | if (cur_size == new_size) { Branch (278:13): [True: 353M, False: 15.3M]
Branch (278:13): [True: 19.0M, False: 39.1M]
Branch (278:13): [True: 62.5k, False: 72.2k]
Branch (278:13): [True: 2.85k, False: 536k]
|
279 | 372M | return; |
280 | 372M | } |
281 | 55.1M | if (cur_size > new_size) { Branch (281:13): [True: 1.31M, False: 14.0M]
Branch (281:13): [True: 24.7M, False: 14.4M]
Branch (281:13): [True: 59.3k, False: 12.8k]
Branch (281:13): [True: 0, False: 536k]
|
282 | 26.0M | erase(item_ptr(new_size), end()); |
283 | 26.0M | return; |
284 | 26.0M | } |
285 | 29.0M | if (new_size > capacity()) { Branch (285:13): [True: 1.69M, False: 12.3M]
Branch (285:13): [True: 14.4M, False: 0]
Branch (285:13): [True: 1.67k, False: 11.1k]
Branch (285:13): [True: 0, False: 536k]
|
286 | 16.1M | change_capacity(new_size); |
287 | 16.1M | } |
288 | 29.0M | ptrdiff_t increase = new_size - cur_size; |
289 | 29.0M | fill(item_ptr(cur_size), increase); |
290 | 29.0M | _size += increase; |
291 | 29.0M | } _ZN9prevectorILj36EhjiE6resizeEj Line | Count | Source | 276 | 369M | void resize(size_type new_size) { | 277 | 369M | size_type cur_size = size(); | 278 | 369M | if (cur_size == new_size) { Branch (278:13): [True: 353M, False: 15.3M]
| 279 | 353M | return; | 280 | 353M | } | 281 | 15.3M | if (cur_size > new_size) { Branch (281:13): [True: 1.31M, False: 14.0M]
| 282 | 1.31M | erase(item_ptr(new_size), end()); | 283 | 1.31M | return; | 284 | 1.31M | } | 285 | 14.0M | if (new_size > capacity()) { Branch (285:13): [True: 1.69M, False: 12.3M]
| 286 | 1.69M | change_capacity(new_size); | 287 | 1.69M | } | 288 | 14.0M | ptrdiff_t increase = new_size - cur_size; | 289 | 14.0M | fill(item_ptr(cur_size), increase); | 290 | 14.0M | _size += increase; | 291 | 14.0M | } |
_ZN9prevectorILj16EhjiE6resizeEj Line | Count | Source | 276 | 58.2M | void resize(size_type new_size) { | 277 | 58.2M | size_type cur_size = size(); | 278 | 58.2M | if (cur_size == new_size) { Branch (278:13): [True: 19.0M, False: 39.1M]
| 279 | 19.0M | return; | 280 | 19.0M | } | 281 | 39.1M | if (cur_size > new_size) { Branch (281:13): [True: 24.7M, False: 14.4M]
| 282 | 24.7M | erase(item_ptr(new_size), end()); | 283 | 24.7M | return; | 284 | 24.7M | } | 285 | 14.4M | if (new_size > capacity()) { Branch (285:13): [True: 14.4M, False: 0]
| 286 | 14.4M | change_capacity(new_size); | 287 | 14.4M | } | 288 | 14.4M | ptrdiff_t increase = new_size - cur_size; | 289 | 14.4M | fill(item_ptr(cur_size), increase); | 290 | 14.4M | _size += increase; | 291 | 14.4M | } |
_ZN9prevectorILj8EijiE6resizeEj Line | Count | Source | 276 | 134k | void resize(size_type new_size) { | 277 | 134k | size_type cur_size = size(); | 278 | 134k | if (cur_size == new_size) { Branch (278:13): [True: 62.5k, False: 72.2k]
| 279 | 62.5k | return; | 280 | 62.5k | } | 281 | 72.2k | if (cur_size > new_size) { Branch (281:13): [True: 59.3k, False: 12.8k]
| 282 | 59.3k | erase(item_ptr(new_size), end()); | 283 | 59.3k | return; | 284 | 59.3k | } | 285 | 12.8k | if (new_size > capacity()) { Branch (285:13): [True: 1.67k, False: 11.1k]
| 286 | 1.67k | change_capacity(new_size); | 287 | 1.67k | } | 288 | 12.8k | ptrdiff_t increase = new_size - cur_size; | 289 | 12.8k | fill(item_ptr(cur_size), increase); | 290 | 12.8k | _size += increase; | 291 | 12.8k | } |
_ZN9prevectorILj33EhjiE6resizeEj Line | Count | Source | 276 | 538k | void resize(size_type new_size) { | 277 | 538k | size_type cur_size = size(); | 278 | 538k | if (cur_size == new_size) { Branch (278:13): [True: 2.85k, False: 536k]
| 279 | 2.85k | return; | 280 | 2.85k | } | 281 | 536k | if (cur_size > new_size) { Branch (281:13): [True: 0, False: 536k]
| 282 | 0 | erase(item_ptr(new_size), end()); | 283 | 0 | return; | 284 | 0 | } | 285 | 536k | if (new_size > capacity()) { Branch (285:13): [True: 0, False: 536k]
| 286 | 0 | change_capacity(new_size); | 287 | 0 | } | 288 | 536k | ptrdiff_t increase = new_size - cur_size; | 289 | 536k | fill(item_ptr(cur_size), increase); | 290 | 536k | _size += increase; | 291 | 536k | } |
|
292 | | |
293 | 12.3k | void reserve(size_type new_capacity) { |
294 | 12.3k | if (new_capacity > capacity()) { Branch (294:13): [True: 166, False: 200]
Branch (294:13): [True: 6.74k, False: 5.28k]
|
295 | 6.90k | change_capacity(new_capacity); |
296 | 6.90k | } |
297 | 12.3k | } _ZN9prevectorILj36EhjiE7reserveEj Line | Count | Source | 293 | 366 | void reserve(size_type new_capacity) { | 294 | 366 | if (new_capacity > capacity()) { Branch (294:13): [True: 166, False: 200]
| 295 | 166 | change_capacity(new_capacity); | 296 | 166 | } | 297 | 366 | } |
_ZN9prevectorILj8EijiE7reserveEj Line | Count | Source | 293 | 12.0k | void reserve(size_type new_capacity) { | 294 | 12.0k | if (new_capacity > capacity()) { Branch (294:13): [True: 6.74k, False: 5.28k]
| 295 | 6.74k | change_capacity(new_capacity); | 296 | 6.74k | } | 297 | 12.0k | } |
|
298 | | |
299 | 103M | void shrink_to_fit() { |
300 | 103M | change_capacity(size()); |
301 | 103M | } _ZN9prevectorILj36EhjiE13shrink_to_fitEv Line | Count | Source | 299 | 103M | void shrink_to_fit() { | 300 | 103M | change_capacity(size()); | 301 | 103M | } |
_ZN9prevectorILj8EijiE13shrink_to_fitEv Line | Count | Source | 299 | 22.8k | void shrink_to_fit() { | 300 | 22.8k | change_capacity(size()); | 301 | 22.8k | } |
|
302 | | |
303 | 364M | void clear() { |
304 | 364M | resize(0); |
305 | 364M | } _ZN9prevectorILj36EhjiE5clearEv Line | Count | Source | 303 | 345M | void clear() { | 304 | 345M | resize(0); | 305 | 345M | } |
_ZN9prevectorILj16EhjiE5clearEv Line | Count | Source | 303 | 18.4M | void clear() { | 304 | 18.4M | resize(0); | 305 | 18.4M | } |
_ZN9prevectorILj8EijiE5clearEv Line | Count | Source | 303 | 108k | void clear() { | 304 | 108k | resize(0); | 305 | 108k | } |
_ZN9prevectorILj33EhjiE5clearEv Line | Count | Source | 303 | 2.85k | void clear() { | 304 | 2.85k | resize(0); | 305 | 2.85k | } |
|
306 | | |
307 | 84.2M | iterator insert(iterator pos, const T& value) { |
308 | 84.2M | size_type p = pos - begin(); |
309 | 84.2M | size_type new_size = size() + 1; |
310 | 84.2M | if (capacity() < new_size) { Branch (310:13): [True: 196k, False: 83.9M]
Branch (310:13): [True: 3.26k, False: 35.9k]
|
311 | 199k | change_capacity(new_size + (new_size >> 1)); |
312 | 199k | } |
313 | 84.2M | T* ptr = item_ptr(p); |
314 | 84.2M | T* dst = ptr + 1; |
315 | 84.2M | memmove(dst, ptr, (size() - p) * sizeof(T)); |
316 | 84.2M | _size++; |
317 | 84.2M | new(static_cast<void*>(ptr)) T(value); |
318 | 84.2M | return iterator(ptr); |
319 | 84.2M | } _ZN9prevectorILj36EhjiE6insertENS0_8iteratorERKh Line | Count | Source | 307 | 84.1M | iterator insert(iterator pos, const T& value) { | 308 | 84.1M | size_type p = pos - begin(); | 309 | 84.1M | size_type new_size = size() + 1; | 310 | 84.1M | if (capacity() < new_size) { Branch (310:13): [True: 196k, False: 83.9M]
| 311 | 196k | change_capacity(new_size + (new_size >> 1)); | 312 | 196k | } | 313 | 84.1M | T* ptr = item_ptr(p); | 314 | 84.1M | T* dst = ptr + 1; | 315 | 84.1M | memmove(dst, ptr, (size() - p) * sizeof(T)); | 316 | 84.1M | _size++; | 317 | 84.1M | new(static_cast<void*>(ptr)) T(value); | 318 | 84.1M | return iterator(ptr); | 319 | 84.1M | } |
_ZN9prevectorILj8EijiE6insertENS0_8iteratorERKi Line | Count | Source | 307 | 39.2k | iterator insert(iterator pos, const T& value) { | 308 | 39.2k | size_type p = pos - begin(); | 309 | 39.2k | size_type new_size = size() + 1; | 310 | 39.2k | if (capacity() < new_size) { Branch (310:13): [True: 3.26k, False: 35.9k]
| 311 | 3.26k | change_capacity(new_size + (new_size >> 1)); | 312 | 3.26k | } | 313 | 39.2k | T* ptr = item_ptr(p); | 314 | 39.2k | T* dst = ptr + 1; | 315 | 39.2k | memmove(dst, ptr, (size() - p) * sizeof(T)); | 316 | 39.2k | _size++; | 317 | 39.2k | new(static_cast<void*>(ptr)) T(value); | 318 | 39.2k | return iterator(ptr); | 319 | 39.2k | } |
|
320 | | |
321 | 32.7k | void insert(iterator pos, size_type count, const T& value) { |
322 | 32.7k | size_type p = pos - begin(); |
323 | 32.7k | size_type new_size = size() + count; |
324 | 32.7k | if (capacity() < new_size) { Branch (324:13): [True: 5.00k, False: 27.7k]
Branch (324:13): [True: 50, False: 0]
|
325 | 5.05k | change_capacity(new_size + (new_size >> 1)); |
326 | 5.05k | } |
327 | 32.7k | T* ptr = item_ptr(p); |
328 | 32.7k | T* dst = ptr + count; |
329 | 32.7k | memmove(dst, ptr, (size() - p) * sizeof(T)); |
330 | 32.7k | _size += count; |
331 | 32.7k | fill(item_ptr(p), count, value); |
332 | 32.7k | } _ZN9prevectorILj8EijiE6insertENS0_8iteratorEjRKi Line | Count | Source | 321 | 32.7k | void insert(iterator pos, size_type count, const T& value) { | 322 | 32.7k | size_type p = pos - begin(); | 323 | 32.7k | size_type new_size = size() + count; | 324 | 32.7k | if (capacity() < new_size) { Branch (324:13): [True: 5.00k, False: 27.7k]
| 325 | 5.00k | change_capacity(new_size + (new_size >> 1)); | 326 | 5.00k | } | 327 | 32.7k | T* ptr = item_ptr(p); | 328 | 32.7k | T* dst = ptr + count; | 329 | 32.7k | memmove(dst, ptr, (size() - p) * sizeof(T)); | 330 | 32.7k | _size += count; | 331 | 32.7k | fill(item_ptr(p), count, value); | 332 | 32.7k | } |
_ZN9prevectorILj36EhjiE6insertENS0_8iteratorEjRKh Line | Count | Source | 321 | 50 | void insert(iterator pos, size_type count, const T& value) { | 322 | 50 | size_type p = pos - begin(); | 323 | 50 | size_type new_size = size() + count; | 324 | 50 | if (capacity() < new_size) { Branch (324:13): [True: 50, False: 0]
| 325 | 50 | change_capacity(new_size + (new_size >> 1)); | 326 | 50 | } | 327 | 50 | T* ptr = item_ptr(p); | 328 | 50 | T* dst = ptr + count; | 329 | 50 | memmove(dst, ptr, (size() - p) * sizeof(T)); | 330 | 50 | _size += count; | 331 | 50 | fill(item_ptr(p), count, value); | 332 | 50 | } |
|
333 | | |
334 | | template <std::input_iterator InputIterator> |
335 | 133M | void insert(iterator pos, InputIterator first, InputIterator last) { |
336 | 133M | size_type p = pos - begin(); |
337 | 133M | difference_type count = last - first; |
338 | 133M | size_type new_size = size() + count; |
339 | 133M | if (capacity() < new_size) { Branch (339:13): [True: 1.03k, False: 61.3k]
Branch (339:13): [True: 1.18M, False: 40.4M]
Branch (339:13): [True: 851k, False: 1.12M]
Branch (339:13): [True: 3.66k, False: 18.2k]
Branch (339:13): [True: 144k, False: 8.99M]
Branch (339:13): [True: 0, False: 68.1k]
Branch (339:13): [True: 0, False: 68.1k]
Branch (339:13): [True: 821k, False: 79.2M]
|
340 | 3.01M | change_capacity(new_size + (new_size >> 1)); |
341 | 3.01M | } |
342 | 133M | T* ptr = item_ptr(p); |
343 | 133M | T* dst = ptr + count; |
344 | 133M | memmove(dst, ptr, (size() - p) * sizeof(T)); |
345 | 133M | _size += count; |
346 | 133M | fill(ptr, first, last); |
347 | 133M | } _ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorPKhEEvNS0_8iteratorET_S5_ Line | Count | Source | 335 | 62.3k | void insert(iterator pos, InputIterator first, InputIterator last) { | 336 | 62.3k | size_type p = pos - begin(); | 337 | 62.3k | difference_type count = last - first; | 338 | 62.3k | size_type new_size = size() + count; | 339 | 62.3k | if (capacity() < new_size) { Branch (339:13): [True: 1.03k, False: 61.3k]
| 340 | 1.03k | change_capacity(new_size + (new_size >> 1)); | 341 | 1.03k | } | 342 | 62.3k | T* ptr = item_ptr(p); | 343 | 62.3k | T* dst = ptr + count; | 344 | 62.3k | memmove(dst, ptr, (size() - p) * sizeof(T)); | 345 | 62.3k | _size += count; | 346 | 62.3k | fill(ptr, first, last); | 347 | 62.3k | } |
_ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvNS0_8iteratorET_SA_ Line | Count | Source | 335 | 41.6M | void insert(iterator pos, InputIterator first, InputIterator last) { | 336 | 41.6M | size_type p = pos - begin(); | 337 | 41.6M | difference_type count = last - first; | 338 | 41.6M | size_type new_size = size() + count; | 339 | 41.6M | if (capacity() < new_size) { Branch (339:13): [True: 1.18M, False: 40.4M]
| 340 | 1.18M | change_capacity(new_size + (new_size >> 1)); | 341 | 1.18M | } | 342 | 41.6M | T* ptr = item_ptr(p); | 343 | 41.6M | T* dst = ptr + count; | 344 | 41.6M | memmove(dst, ptr, (size() - p) * sizeof(T)); | 345 | 41.6M | _size += count; | 346 | 41.6M | fill(ptr, first, last); | 347 | 41.6M | } |
_ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorNS0_8iteratorEEEvS2_T_S3_ Line | Count | Source | 335 | 1.97M | void insert(iterator pos, InputIterator first, InputIterator last) { | 336 | 1.97M | size_type p = pos - begin(); | 337 | 1.97M | difference_type count = last - first; | 338 | 1.97M | size_type new_size = size() + count; | 339 | 1.97M | if (capacity() < new_size) { Branch (339:13): [True: 851k, False: 1.12M]
| 340 | 851k | change_capacity(new_size + (new_size >> 1)); | 341 | 851k | } | 342 | 1.97M | T* ptr = item_ptr(p); | 343 | 1.97M | T* dst = ptr + count; | 344 | 1.97M | memmove(dst, ptr, (size() - p) * sizeof(T)); | 345 | 1.97M | _size += count; | 346 | 1.97M | fill(ptr, first, last); | 347 | 1.97M | } |
_ZN9prevectorILj8EijiE6insertITkSt14input_iteratorPiEEvNS0_8iteratorET_S4_ Line | Count | Source | 335 | 21.9k | void insert(iterator pos, InputIterator first, InputIterator last) { | 336 | 21.9k | size_type p = pos - begin(); | 337 | 21.9k | difference_type count = last - first; | 338 | 21.9k | size_type new_size = size() + count; | 339 | 21.9k | if (capacity() < new_size) { Branch (339:13): [True: 3.66k, False: 18.2k]
| 340 | 3.66k | change_capacity(new_size + (new_size >> 1)); | 341 | 3.66k | } | 342 | 21.9k | T* ptr = item_ptr(p); | 343 | 21.9k | T* dst = ptr + count; | 344 | 21.9k | memmove(dst, ptr, (size() - p) * sizeof(T)); | 345 | 21.9k | _size += count; | 346 | 21.9k | fill(ptr, first, last); | 347 | 21.9k | } |
_ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEEvNS0_8iteratorET_SA_ Line | Count | Source | 335 | 9.13M | void insert(iterator pos, InputIterator first, InputIterator last) { | 336 | 9.13M | size_type p = pos - begin(); | 337 | 9.13M | difference_type count = last - first; | 338 | 9.13M | size_type new_size = size() + count; | 339 | 9.13M | if (capacity() < new_size) { Branch (339:13): [True: 144k, False: 8.99M]
| 340 | 144k | change_capacity(new_size + (new_size >> 1)); | 341 | 144k | } | 342 | 9.13M | T* ptr = item_ptr(p); | 343 | 9.13M | T* dst = ptr + count; | 344 | 9.13M | memmove(dst, ptr, (size() - p) * sizeof(T)); | 345 | 9.13M | _size += count; | 346 | 9.13M | fill(ptr, first, last); | 347 | 9.13M | } |
_ZN9prevectorILj35EhjiE6insertITkSt14input_iteratorPhEEvNS0_8iteratorET_S4_ Line | Count | Source | 335 | 68.1k | void insert(iterator pos, InputIterator first, InputIterator last) { | 336 | 68.1k | size_type p = pos - begin(); | 337 | 68.1k | difference_type count = last - first; | 338 | 68.1k | size_type new_size = size() + count; | 339 | 68.1k | if (capacity() < new_size) { Branch (339:13): [True: 0, False: 68.1k]
| 340 | 0 | change_capacity(new_size + (new_size >> 1)); | 341 | 0 | } | 342 | 68.1k | T* ptr = item_ptr(p); | 343 | 68.1k | T* dst = ptr + count; | 344 | 68.1k | memmove(dst, ptr, (size() - p) * sizeof(T)); | 345 | 68.1k | _size += count; | 346 | 68.1k | fill(ptr, first, last); | 347 | 68.1k | } |
_ZN9prevectorILj35EhjiE6insertITkSt14input_iteratorPKhEEvNS0_8iteratorET_S5_ Line | Count | Source | 335 | 68.1k | void insert(iterator pos, InputIterator first, InputIterator last) { | 336 | 68.1k | size_type p = pos - begin(); | 337 | 68.1k | difference_type count = last - first; | 338 | 68.1k | size_type new_size = size() + count; | 339 | 68.1k | if (capacity() < new_size) { Branch (339:13): [True: 0, False: 68.1k]
| 340 | 0 | change_capacity(new_size + (new_size >> 1)); | 341 | 0 | } | 342 | 68.1k | T* ptr = item_ptr(p); | 343 | 68.1k | T* dst = ptr + count; | 344 | 68.1k | memmove(dst, ptr, (size() - p) * sizeof(T)); | 345 | 68.1k | _size += count; | 346 | 68.1k | fill(ptr, first, last); | 347 | 68.1k | } |
_ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorNS0_14const_iteratorEEEvNS0_8iteratorET_S4_ Line | Count | Source | 335 | 80.1M | void insert(iterator pos, InputIterator first, InputIterator last) { | 336 | 80.1M | size_type p = pos - begin(); | 337 | 80.1M | difference_type count = last - first; | 338 | 80.1M | size_type new_size = size() + count; | 339 | 80.1M | if (capacity() < new_size) { Branch (339:13): [True: 821k, False: 79.2M]
| 340 | 821k | change_capacity(new_size + (new_size >> 1)); | 341 | 821k | } | 342 | 80.1M | T* ptr = item_ptr(p); | 343 | 80.1M | T* dst = ptr + count; | 344 | 80.1M | memmove(dst, ptr, (size() - p) * sizeof(T)); | 345 | 80.1M | _size += count; | 346 | 80.1M | fill(ptr, first, last); | 347 | 80.1M | } |
|
348 | | |
349 | 11.4M | inline void resize_uninitialized(size_type new_size) { |
350 | | // resize_uninitialized changes the size of the prevector but does not initialize it. |
351 | | // If size < new_size, the added elements must be initialized explicitly. |
352 | 11.4M | if (capacity() < new_size) { Branch (352:13): [True: 2.69M, False: 8.75M]
Branch (352:13): [True: 3.30k, False: 15.2k]
|
353 | 2.69M | change_capacity(new_size); |
354 | 2.69M | _size += new_size - size(); |
355 | 2.69M | return; |
356 | 2.69M | } |
357 | 8.77M | if (new_size < size()) { Branch (357:13): [True: 0, False: 8.75M]
Branch (357:13): [True: 6.11k, False: 9.11k]
|
358 | 6.11k | erase(item_ptr(new_size), end()); |
359 | 8.76M | } else { |
360 | 8.76M | _size += new_size - size(); |
361 | 8.76M | } |
362 | 8.77M | } _ZN9prevectorILj36EhjiE20resize_uninitializedEj Line | Count | Source | 349 | 11.4M | inline void resize_uninitialized(size_type new_size) { | 350 | | // resize_uninitialized changes the size of the prevector but does not initialize it. | 351 | | // If size < new_size, the added elements must be initialized explicitly. | 352 | 11.4M | if (capacity() < new_size) { Branch (352:13): [True: 2.69M, False: 8.75M]
| 353 | 2.69M | change_capacity(new_size); | 354 | 2.69M | _size += new_size - size(); | 355 | 2.69M | return; | 356 | 2.69M | } | 357 | 8.75M | if (new_size < size()) { Branch (357:13): [True: 0, False: 8.75M]
| 358 | 0 | erase(item_ptr(new_size), end()); | 359 | 8.75M | } else { | 360 | 8.75M | _size += new_size - size(); | 361 | 8.75M | } | 362 | 8.75M | } |
_ZN9prevectorILj8EijiE20resize_uninitializedEj Line | Count | Source | 349 | 18.5k | inline void resize_uninitialized(size_type new_size) { | 350 | | // resize_uninitialized changes the size of the prevector but does not initialize it. | 351 | | // If size < new_size, the added elements must be initialized explicitly. | 352 | 18.5k | if (capacity() < new_size) { Branch (352:13): [True: 3.30k, False: 15.2k]
| 353 | 3.30k | change_capacity(new_size); | 354 | 3.30k | _size += new_size - size(); | 355 | 3.30k | return; | 356 | 3.30k | } | 357 | 15.2k | if (new_size < size()) { Branch (357:13): [True: 6.11k, False: 9.11k]
| 358 | 6.11k | erase(item_ptr(new_size), end()); | 359 | 9.11k | } else { | 360 | 9.11k | _size += new_size - size(); | 361 | 9.11k | } | 362 | 15.2k | } |
|
363 | | |
364 | 9.19k | iterator erase(iterator pos) { |
365 | 9.19k | return erase(pos, pos + 1); |
366 | 9.19k | } _ZN9prevectorILj8EijiE5eraseENS0_8iteratorE Line | Count | Source | 364 | 9.17k | iterator erase(iterator pos) { | 365 | 9.17k | return erase(pos, pos + 1); | 366 | 9.17k | } |
_ZN9prevectorILj33EhjiE5eraseENS0_8iteratorE Line | Count | Source | 364 | 22 | iterator erase(iterator pos) { | 365 | 22 | return erase(pos, pos + 1); | 366 | 22 | } |
|
367 | | |
368 | 26.1M | iterator erase(iterator first, iterator last) { |
369 | | // Erase is not allowed to the change the object's capacity. That means |
370 | | // that when starting with an indirectly allocated prevector with |
371 | | // size and capacity > N, the result may be a still indirectly allocated |
372 | | // prevector with size <= N and capacity > N. A shrink_to_fit() call is |
373 | | // necessary to switch to the (more efficient) directly allocated |
374 | | // representation (with capacity N and size <= N). |
375 | 26.1M | iterator p = first; |
376 | 26.1M | char* endp = (char*)&(*end()); |
377 | 26.1M | _size -= last - p; |
378 | 26.1M | memmove(&(*first), &(*last), endp - ((char*)(&(*last)))); |
379 | 26.1M | return first; |
380 | 26.1M | } _ZN9prevectorILj36EhjiE5eraseENS0_8iteratorES1_ Line | Count | Source | 368 | 1.31M | iterator erase(iterator first, iterator last) { | 369 | | // Erase is not allowed to the change the object's capacity. That means | 370 | | // that when starting with an indirectly allocated prevector with | 371 | | // size and capacity > N, the result may be a still indirectly allocated | 372 | | // prevector with size <= N and capacity > N. A shrink_to_fit() call is | 373 | | // necessary to switch to the (more efficient) directly allocated | 374 | | // representation (with capacity N and size <= N). | 375 | 1.31M | iterator p = first; | 376 | 1.31M | char* endp = (char*)&(*end()); | 377 | 1.31M | _size -= last - p; | 378 | 1.31M | memmove(&(*first), &(*last), endp - ((char*)(&(*last)))); | 379 | 1.31M | return first; | 380 | 1.31M | } |
_ZN9prevectorILj16EhjiE5eraseENS0_8iteratorES1_ Line | Count | Source | 368 | 24.7M | iterator erase(iterator first, iterator last) { | 369 | | // Erase is not allowed to the change the object's capacity. That means | 370 | | // that when starting with an indirectly allocated prevector with | 371 | | // size and capacity > N, the result may be a still indirectly allocated | 372 | | // prevector with size <= N and capacity > N. A shrink_to_fit() call is | 373 | | // necessary to switch to the (more efficient) directly allocated | 374 | | // representation (with capacity N and size <= N). | 375 | 24.7M | iterator p = first; | 376 | 24.7M | char* endp = (char*)&(*end()); | 377 | 24.7M | _size -= last - p; | 378 | 24.7M | memmove(&(*first), &(*last), endp - ((char*)(&(*last)))); | 379 | 24.7M | return first; | 380 | 24.7M | } |
_ZN9prevectorILj8EijiE5eraseENS0_8iteratorES1_ Line | Count | Source | 368 | 103k | iterator erase(iterator first, iterator last) { | 369 | | // Erase is not allowed to the change the object's capacity. That means | 370 | | // that when starting with an indirectly allocated prevector with | 371 | | // size and capacity > N, the result may be a still indirectly allocated | 372 | | // prevector with size <= N and capacity > N. A shrink_to_fit() call is | 373 | | // necessary to switch to the (more efficient) directly allocated | 374 | | // representation (with capacity N and size <= N). | 375 | 103k | iterator p = first; | 376 | 103k | char* endp = (char*)&(*end()); | 377 | 103k | _size -= last - p; | 378 | 103k | memmove(&(*first), &(*last), endp - ((char*)(&(*last)))); | 379 | 103k | return first; | 380 | 103k | } |
_ZN9prevectorILj33EhjiE5eraseENS0_8iteratorES1_ Line | Count | Source | 368 | 22 | iterator erase(iterator first, iterator last) { | 369 | | // Erase is not allowed to the change the object's capacity. That means | 370 | | // that when starting with an indirectly allocated prevector with | 371 | | // size and capacity > N, the result may be a still indirectly allocated | 372 | | // prevector with size <= N and capacity > N. A shrink_to_fit() call is | 373 | | // necessary to switch to the (more efficient) directly allocated | 374 | | // representation (with capacity N and size <= N). | 375 | 22 | iterator p = first; | 376 | 22 | char* endp = (char*)&(*end()); | 377 | 22 | _size -= last - p; | 378 | 22 | memmove(&(*first), &(*last), endp - ((char*)(&(*last)))); | 379 | 22 | return first; | 380 | 22 | } |
|
381 | | |
382 | | template<typename... Args> |
383 | 1.95M | void emplace_back(Args&&... args) { |
384 | 1.95M | size_type new_size = size() + 1; |
385 | 1.95M | if (capacity() < new_size) { Branch (385:13): [True: 20.7k, False: 1.92M]
Branch (385:13): [True: 1.87k, False: 10.8k]
Branch (385:13): [True: 0, False: 0]
|
386 | 22.6k | change_capacity(new_size + (new_size >> 1)); |
387 | 22.6k | } |
388 | 1.95M | new(item_ptr(size())) T(std::forward<Args>(args)...); |
389 | 1.95M | _size++; |
390 | 1.95M | } _ZN9prevectorILj36EhjiE12emplace_backIJRKhEEEvDpOT_ Line | Count | Source | 383 | 1.94M | void emplace_back(Args&&... args) { | 384 | 1.94M | size_type new_size = size() + 1; | 385 | 1.94M | if (capacity() < new_size) { Branch (385:13): [True: 20.7k, False: 1.92M]
| 386 | 20.7k | change_capacity(new_size + (new_size >> 1)); | 387 | 20.7k | } | 388 | 1.94M | new(item_ptr(size())) T(std::forward<Args>(args)...); | 389 | 1.94M | _size++; | 390 | 1.94M | } |
_ZN9prevectorILj8EijiE12emplace_backIJRKiEEEvDpOT_ Line | Count | Source | 383 | 12.6k | void emplace_back(Args&&... args) { | 384 | 12.6k | size_type new_size = size() + 1; | 385 | 12.6k | if (capacity() < new_size) { Branch (385:13): [True: 1.87k, False: 10.8k]
| 386 | 1.87k | change_capacity(new_size + (new_size >> 1)); | 387 | 1.87k | } | 388 | 12.6k | new(item_ptr(size())) T(std::forward<Args>(args)...); | 389 | 12.6k | _size++; | 390 | 12.6k | } |
Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiE12emplace_backIJRKS0_EEEvDpOT_ |
391 | | |
392 | 1.95M | void push_back(const T& value) { |
393 | 1.95M | emplace_back(value); |
394 | 1.95M | } _ZN9prevectorILj36EhjiE9push_backERKh Line | Count | Source | 392 | 1.94M | void push_back(const T& value) { | 393 | 1.94M | emplace_back(value); | 394 | 1.94M | } |
_ZN9prevectorILj8EijiE9push_backERKi Line | Count | Source | 392 | 12.6k | void push_back(const T& value) { | 393 | 12.6k | emplace_back(value); | 394 | 12.6k | } |
Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiE9push_backERKS0_ |
395 | | |
396 | 12.4k | void pop_back() { |
397 | 12.4k | erase(end() - 1, end()); |
398 | 12.4k | } |
399 | | |
400 | | T& front() { |
401 | | return *item_ptr(0); |
402 | | } |
403 | | |
404 | | const T& front() const { |
405 | | return *item_ptr(0); |
406 | | } |
407 | | |
408 | 21.2k | T& back() { |
409 | 21.2k | return *item_ptr(size() - 1); |
410 | 21.2k | } |
411 | | |
412 | 5.79M | const T& back() const { |
413 | 5.79M | return *item_ptr(size() - 1); |
414 | 5.79M | } |
415 | | |
416 | | void swap(prevector<N, T, Size, Diff>& other) noexcept |
417 | 17.4k | { |
418 | 17.4k | std::swap(_union, other._union); |
419 | 17.4k | std::swap(_size, other._size); |
420 | 17.4k | } |
421 | | |
422 | 1.89G | ~prevector() { |
423 | 1.89G | if (!is_direct()) { Branch (423:13): [True: 178M, False: 416M]
Branch (423:13): [True: 15.8M, False: 1.27G]
Branch (423:13): [True: 580, False: 7.32M]
Branch (423:13): [True: 851, False: 817]
Branch (423:13): [True: 0, False: 68.1k]
Branch (423:13): [True: 0, False: 0]
|
424 | 194M | free(_union.indirect_contents.indirect); |
425 | 194M | _union.indirect_contents.indirect = nullptr; |
426 | 194M | } |
427 | 1.89G | } _ZN9prevectorILj16EhjiED2Ev Line | Count | Source | 422 | 595M | ~prevector() { | 423 | 595M | if (!is_direct()) { Branch (423:13): [True: 178M, False: 416M]
| 424 | 178M | free(_union.indirect_contents.indirect); | 425 | 178M | _union.indirect_contents.indirect = nullptr; | 426 | 178M | } | 427 | 595M | } |
_ZN9prevectorILj36EhjiED2Ev Line | Count | Source | 422 | 1.29G | ~prevector() { | 423 | 1.29G | if (!is_direct()) { Branch (423:13): [True: 15.8M, False: 1.27G]
| 424 | 15.8M | free(_union.indirect_contents.indirect); | 425 | 15.8M | _union.indirect_contents.indirect = nullptr; | 426 | 15.8M | } | 427 | 1.29G | } |
_ZN9prevectorILj33EhjiED2Ev Line | Count | Source | 422 | 7.32M | ~prevector() { | 423 | 7.32M | if (!is_direct()) { Branch (423:13): [True: 580, False: 7.32M]
| 424 | 580 | free(_union.indirect_contents.indirect); | 425 | 580 | _union.indirect_contents.indirect = nullptr; | 426 | 580 | } | 427 | 7.32M | } |
_ZN9prevectorILj8EijiED2Ev Line | Count | Source | 422 | 1.66k | ~prevector() { | 423 | 1.66k | if (!is_direct()) { Branch (423:13): [True: 851, False: 817]
| 424 | 851 | free(_union.indirect_contents.indirect); | 425 | 851 | _union.indirect_contents.indirect = nullptr; | 426 | 851 | } | 427 | 1.66k | } |
_ZN9prevectorILj35EhjiED2Ev Line | Count | Source | 422 | 68.1k | ~prevector() { | 423 | 68.1k | if (!is_direct()) { Branch (423:13): [True: 0, False: 68.1k]
| 424 | 0 | free(_union.indirect_contents.indirect); | 425 | 0 | _union.indirect_contents.indirect = nullptr; | 426 | 0 | } | 427 | 68.1k | } |
Unexecuted instantiation: _ZN9prevectorILj4E7NetworkjiED2Ev |
428 | | |
429 | 83.1M | constexpr bool operator==(const prevector& other) const { |
430 | 83.1M | return std::ranges::equal(*this, other); |
431 | 83.1M | } _ZNK9prevectorILj36EhjiEeqERKS0_ Line | Count | Source | 429 | 3.29M | constexpr bool operator==(const prevector& other) const { | 430 | 3.29M | return std::ranges::equal(*this, other); | 431 | 3.29M | } |
_ZNK9prevectorILj8EijiEeqERKS0_ Line | Count | Source | 429 | 834 | constexpr bool operator==(const prevector& other) const { | 430 | 834 | return std::ranges::equal(*this, other); | 431 | 834 | } |
_ZNK9prevectorILj16EhjiEeqERKS0_ Line | Count | Source | 429 | 79.8M | constexpr bool operator==(const prevector& other) const { | 430 | 79.8M | return std::ranges::equal(*this, other); | 431 | 79.8M | } |
|
432 | | |
433 | 82.7M | bool operator<(const prevector<N, T, Size, Diff>& other) const { |
434 | 82.7M | if (size() < other.size()) { Branch (434:13): [True: 727k, False: 11.2M]
Branch (434:13): [True: 0, False: 70.7M]
|
435 | 727k | return true; |
436 | 727k | } |
437 | 82.0M | if (size() > other.size()) { Branch (437:13): [True: 429k, False: 10.8M]
Branch (437:13): [True: 0, False: 70.7M]
|
438 | 429k | return false; |
439 | 429k | } |
440 | 81.5M | const_iterator b1 = begin(); |
441 | 81.5M | const_iterator b2 = other.begin(); |
442 | 81.5M | const_iterator e1 = end(); |
443 | 548M | while (b1 != e1) { Branch (443:16): [True: 82.3M, False: 1.82M]
Branch (443:16): [True: 446M, False: 17.3M]
|
444 | 528M | if ((*b1) < (*b2)) { Branch (444:17): [True: 5.27M, False: 77.0M]
Branch (444:17): [True: 39.2M, False: 407M]
|
445 | 44.4M | return true; |
446 | 44.4M | } |
447 | 484M | if ((*b2) < (*b1)) { Branch (447:17): [True: 3.75M, False: 73.3M]
Branch (447:17): [True: 14.1M, False: 393M]
|
448 | 17.9M | return false; |
449 | 17.9M | } |
450 | 466M | ++b1; |
451 | 466M | ++b2; |
452 | 466M | } |
453 | 19.1M | return false; |
454 | 81.5M | } _ZNK9prevectorILj36EhjiEltERKS0_ Line | Count | Source | 433 | 12.0M | bool operator<(const prevector<N, T, Size, Diff>& other) const { | 434 | 12.0M | if (size() < other.size()) { Branch (434:13): [True: 727k, False: 11.2M]
| 435 | 727k | return true; | 436 | 727k | } | 437 | 11.2M | if (size() > other.size()) { Branch (437:13): [True: 429k, False: 10.8M]
| 438 | 429k | return false; | 439 | 429k | } | 440 | 10.8M | const_iterator b1 = begin(); | 441 | 10.8M | const_iterator b2 = other.begin(); | 442 | 10.8M | const_iterator e1 = end(); | 443 | 84.1M | while (b1 != e1) { Branch (443:16): [True: 82.3M, False: 1.82M]
| 444 | 82.3M | if ((*b1) < (*b2)) { Branch (444:17): [True: 5.27M, False: 77.0M]
| 445 | 5.27M | return true; | 446 | 5.27M | } | 447 | 77.0M | if ((*b2) < (*b1)) { Branch (447:17): [True: 3.75M, False: 73.3M]
| 448 | 3.75M | return false; | 449 | 3.75M | } | 450 | 73.3M | ++b1; | 451 | 73.3M | ++b2; | 452 | 73.3M | } | 453 | 1.82M | return false; | 454 | 10.8M | } |
_ZNK9prevectorILj16EhjiEltERKS0_ Line | Count | Source | 433 | 70.7M | bool operator<(const prevector<N, T, Size, Diff>& other) const { | 434 | 70.7M | if (size() < other.size()) { Branch (434:13): [True: 0, False: 70.7M]
| 435 | 0 | return true; | 436 | 0 | } | 437 | 70.7M | if (size() > other.size()) { Branch (437:13): [True: 0, False: 70.7M]
| 438 | 0 | return false; | 439 | 0 | } | 440 | 70.7M | const_iterator b1 = begin(); | 441 | 70.7M | const_iterator b2 = other.begin(); | 442 | 70.7M | const_iterator e1 = end(); | 443 | 463M | while (b1 != e1) { Branch (443:16): [True: 446M, False: 17.3M]
| 444 | 446M | if ((*b1) < (*b2)) { Branch (444:17): [True: 39.2M, False: 407M]
| 445 | 39.2M | return true; | 446 | 39.2M | } | 447 | 407M | if ((*b2) < (*b1)) { Branch (447:17): [True: 14.1M, False: 393M]
| 448 | 14.1M | return false; | 449 | 14.1M | } | 450 | 393M | ++b1; | 451 | 393M | ++b2; | 452 | 393M | } | 453 | 17.3M | return false; | 454 | 70.7M | } |
|
455 | | |
456 | 72.4M | size_t allocated_memory() const { |
457 | 72.4M | if (is_direct()) { Branch (457:13): [True: 70.0M, False: 2.42M]
|
458 | 70.0M | return 0; |
459 | 70.0M | } else { |
460 | 2.42M | return ((size_t)(sizeof(T))) * _union.indirect_contents.capacity; |
461 | 2.42M | } |
462 | 72.4M | } |
463 | | |
464 | 64.7M | value_type* data() { |
465 | 64.7M | return item_ptr(0); |
466 | 64.7M | } _ZN9prevectorILj33EhjiE4dataEv Line | Count | Source | 464 | 1.54M | value_type* data() { | 465 | 1.54M | return item_ptr(0); | 466 | 1.54M | } |
_ZN9prevectorILj36EhjiE4dataEv Line | Count | Source | 464 | 23.4M | value_type* data() { | 465 | 23.4M | return item_ptr(0); | 466 | 23.4M | } |
_ZN9prevectorILj16EhjiE4dataEv Line | Count | Source | 464 | 39.7M | value_type* data() { | 465 | 39.7M | return item_ptr(0); | 466 | 39.7M | } |
_ZN9prevectorILj35EhjiE4dataEv Line | Count | Source | 464 | 68.1k | value_type* data() { | 465 | 68.1k | return item_ptr(0); | 466 | 68.1k | } |
|
467 | | |
468 | 2.10G | const value_type* data() const { |
469 | 2.10G | return item_ptr(0); |
470 | 2.10G | } _ZNK9prevectorILj36EhjiE4dataEv Line | Count | Source | 468 | 1.30G | const value_type* data() const { | 469 | 1.30G | return item_ptr(0); | 470 | 1.30G | } |
_ZNK9prevectorILj16EhjiE4dataEv Line | Count | Source | 468 | 800M | const value_type* data() const { | 469 | 800M | return item_ptr(0); | 470 | 800M | } |
_ZNK9prevectorILj33EhjiE4dataEv Line | Count | Source | 468 | 1.00M | const value_type* data() const { | 469 | 1.00M | return item_ptr(0); | 470 | 1.00M | } |
|
471 | | }; |
472 | | |
473 | | #endif // BITCOIN_PREVECTOR_H |