Coverage Report

Created: 2026-07-14 18:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/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
9.65M
        iterator(T* ptr_) : ptr(ptr_) {}
prevector<16u, unsigned char, unsigned int, int>::iterator::iterator(unsigned char*)
Line
Count
Source
60
2.93M
        iterator(T* ptr_) : ptr(ptr_) {}
prevector<36u, unsigned char, unsigned int, int>::iterator::iterator(unsigned char*)
Line
Count
Source
60
6.71M
        iterator(T* ptr_) : ptr(ptr_) {}
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::iterator::iterator(unsigned char*)
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::iterator::iterator(unsigned char*)
61
18.7M
        T& operator*() const { return *ptr; }
prevector<36u, unsigned char, unsigned int, int>::iterator::operator*() const
Line
Count
Source
61
12.8M
        T& operator*() const { return *ptr; }
prevector<16u, unsigned char, unsigned int, int>::iterator::operator*() const
Line
Count
Source
61
5.87M
        T& operator*() const { return *ptr; }
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::iterator::operator*() const
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::iterator::operator*() const
62
0
        T* operator->() const { return ptr; }
Unexecuted instantiation: prevector<16u, unsigned char, unsigned int, int>::iterator::operator->() const
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::iterator::operator->() const
Unexecuted instantiation: prevector<36u, unsigned char, unsigned int, int>::iterator::operator->() const
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::iterator::operator->() const
63
        T& operator[](size_type pos) const { return ptr[pos]; }
64
213k
        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
3.19M
        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
operator-(prevector<36u, unsigned char, unsigned int, int>::iterator, prevector<36u, unsigned char, unsigned int, int>::iterator)
Line
Count
Source
68
2.21M
        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
operator-(prevector<16u, unsigned char, unsigned int, int>::iterator, prevector<16u, unsigned char, unsigned int, int>::iterator)
Line
Count
Source
68
979k
        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
Unexecuted instantiation: operator-(prevector<33u, unsigned char, unsigned int, int>::iterator, prevector<33u, unsigned char, unsigned int, int>::iterator)
Unexecuted instantiation: operator-(prevector<35u, unsigned char, unsigned int, int>::iterator, prevector<35u, unsigned char, unsigned int, int>::iterator)
69
        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
        iterator operator-(size_type n) const { return iterator(ptr - n); }
73
        iterator& operator-=(size_type n) { ptr -= n; return *this; }
74
284k
        bool operator==(iterator x) const { return ptr == x.ptr; }
75
0
        auto operator<=>(iterator x) const { return ptr <=> x.ptr; }
Unexecuted instantiation: prevector<16u, unsigned char, unsigned int, int>::iterator::operator<=>(prevector<16u, unsigned char, unsigned int, int>::iterator) const
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::iterator::operator<=>(prevector<33u, unsigned char, unsigned int, int>::iterator) const
Unexecuted instantiation: prevector<36u, unsigned char, unsigned int, int>::iterator::operator<=>(prevector<36u, unsigned char, unsigned int, int>::iterator) const
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::iterator::operator<=>(prevector<35u, unsigned char, unsigned int, int>::iterator) const
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
169M
        const_iterator(const T* ptr_) : ptr(ptr_) {}
prevector<16u, unsigned char, unsigned int, int>::const_iterator::const_iterator(unsigned char const*)
Line
Count
Source
87
36.1M
        const_iterator(const T* ptr_) : ptr(ptr_) {}
prevector<36u, unsigned char, unsigned int, int>::const_iterator::const_iterator(unsigned char const*)
Line
Count
Source
87
133M
        const_iterator(const T* ptr_) : ptr(ptr_) {}
88
12.0k
        const_iterator(iterator x) : ptr(&(*x)) {}
89
31.2G
        const T& operator*() const { return *ptr; }
prevector<36u, unsigned char, unsigned int, int>::const_iterator::operator*() const
Line
Count
Source
89
31.1G
        const T& operator*() const { return *ptr; }
prevector<16u, unsigned char, unsigned int, int>::const_iterator::operator*() const
Line
Count
Source
89
81.9M
        const T& operator*() const { return *ptr; }
90
0
        const T* operator->() const { return ptr; }
Unexecuted instantiation: prevector<36u, unsigned char, unsigned int, int>::const_iterator::operator->() const
Unexecuted instantiation: prevector<16u, unsigned char, unsigned int, int>::const_iterator::operator->() const
91
345k
        const T& operator[](size_type pos) const { return ptr[pos]; }
92
31.0G
        const_iterator& operator++() { ptr++; return *this; }
prevector<36u, unsigned char, unsigned int, int>::const_iterator::operator++()
Line
Count
Source
92
31.0G
        const_iterator& operator++() { ptr++; return *this; }
prevector<16u, unsigned char, unsigned int, int>::const_iterator::operator++()
Line
Count
Source
92
53.1M
        const_iterator& operator++() { ptr++; return *this; }
93
0
        const_iterator& operator--() { ptr--; return *this; }
94
11.3M
        const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; }
95
        const_iterator operator--(int) { const_iterator copy(*this); --(*this); return copy; }
96
40.7M
        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
operator-(prevector<36u, unsigned char, unsigned int, int>::const_iterator, prevector<36u, unsigned char, unsigned int, int>::const_iterator)
Line
Count
Source
96
38.9M
        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
operator-(prevector<16u, unsigned char, unsigned int, int>::const_iterator, prevector<16u, unsigned char, unsigned int, int>::const_iterator)
Line
Count
Source
96
1.83M
        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
97
9.88M
        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
8.43M
        const_iterator& operator+=(size_type n) { ptr += n; return *this; }
100
0
        const_iterator operator-(size_type n) const { return const_iterator(ptr - n); }
101
        const_iterator& operator-=(size_type n) { ptr -= n; return *this; }
102
31.0G
        bool operator==(const_iterator x) const { return ptr == x.ptr; }
prevector<36u, unsigned char, unsigned int, int>::const_iterator::operator==(prevector<36u, unsigned char, unsigned int, int>::const_iterator) const
Line
Count
Source
102
31.0G
        bool operator==(const_iterator x) const { return ptr == x.ptr; }
prevector<16u, unsigned char, unsigned int, int>::const_iterator::operator==(prevector<16u, unsigned char, unsigned int, int>::const_iterator) const
Line
Count
Source
102
56.1M
        bool operator==(const_iterator x) const { return ptr == x.ptr; }
103
34.0M
        auto operator<=>(const_iterator x) const { return ptr <=> x.ptr; }
Unexecuted instantiation: prevector<16u, unsigned char, unsigned int, int>::const_iterator::operator<=>(prevector<16u, unsigned char, unsigned int, int>::const_iterator) const
prevector<36u, unsigned char, unsigned int, int>::const_iterator::operator<=>(prevector<36u, unsigned char, unsigned int, int>::const_iterator) const
Line
Count
Source
103
34.0M
        auto operator<=>(const_iterator x) const { return ptr <=> x.ptr; }
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
48.5M
    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
prevector<36u, unsigned char, unsigned int, int>::direct_ptr(int)
Line
Count
Source
122
36.1M
    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
prevector<16u, unsigned char, unsigned int, int>::direct_ptr(int)
Line
Count
Source
122
12.3M
    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
prevector<33u, unsigned char, unsigned int, int>::direct_ptr(int)
Line
Count
Source
122
95.0k
    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::direct_ptr(int)
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::direct_ptr(int)
123
293M
    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
prevector<36u, unsigned char, unsigned int, int>::direct_ptr(int) const
Line
Count
Source
123
220M
    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
prevector<16u, unsigned char, unsigned int, int>::direct_ptr(int) const
Line
Count
Source
123
72.9M
    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
prevector<33u, unsigned char, unsigned int, int>::direct_ptr(int) const
Line
Count
Source
123
1.40k
    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
124
1.59M
    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
prevector<36u, unsigned char, unsigned int, int>::indirect_ptr(int)
Line
Count
Source
124
1.33M
    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
prevector<16u, unsigned char, unsigned int, int>::indirect_ptr(int)
Line
Count
Source
124
264k
    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::indirect_ptr(int)
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::indirect_ptr(int)
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::indirect_ptr(int)
125
12.7M
    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
prevector<36u, unsigned char, unsigned int, int>::indirect_ptr(int) const
Line
Count
Source
125
12.2M
    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
prevector<16u, unsigned char, unsigned int, int>::indirect_ptr(int) const
Line
Count
Source
125
531k
    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::indirect_ptr(int) const
126
1.37G
    bool is_direct() const { return _size <= N; }
prevector<36u, unsigned char, unsigned int, int>::is_direct() const
Line
Count
Source
126
1.17G
    bool is_direct() const { return _size <= N; }
prevector<16u, unsigned char, unsigned int, int>::is_direct() const
Line
Count
Source
126
163M
    bool is_direct() const { return _size <= N; }
prevector<33u, unsigned char, unsigned int, int>::is_direct() const
Line
Count
Source
126
30.4M
    bool is_direct() const { return _size <= N; }
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::is_direct() const
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::is_direct() const
127
128
65.8M
    void change_capacity(size_type new_capacity) {
129
65.8M
        if (new_capacity <= N) {
  Branch (129:13): [True: 56.2M, False: 1.32M]
  Branch (129:13): [True: 8.09M, False: 133k]
  Branch (129:13): [True: 0, False: 0]
  Branch (129:13): [True: 1.40k, False: 0]
  Branch (129:13): [True: 0, False: 0]
130
64.3M
            if (!is_direct()) {
  Branch (130:17): [True: 0, False: 56.2M]
  Branch (130:17): [True: 0, False: 8.09M]
  Branch (130:17): [True: 0, False: 0]
  Branch (130:17): [True: 0, False: 1.40k]
  Branch (130:17): [True: 0, False: 0]
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
64.3M
        } else {
139
1.45M
            if (!is_direct()) {
  Branch (139:17): [True: 84, False: 1.32M]
  Branch (139:17): [True: 0, False: 133k]
  Branch (139:17): [True: 0, False: 0]
  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
84
                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
144
84
                assert(_union.indirect_contents.indirect);
  Branch (144:17): [True: 84, False: 0]
  Branch (144:17): [True: 0, False: 0]
  Branch (144:17): [True: 0, False: 0]
  Branch (144:17): [True: 0, False: 0]
  Branch (144:17): [True: 0, False: 0]
145
84
                _union.indirect_contents.capacity = new_capacity;
146
1.45M
            } else {
147
1.45M
                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
148
1.45M
                assert(new_indirect);
  Branch (148:17): [True: 1.32M, False: 18.4E]
  Branch (148:17): [True: 133k, False: 18.4E]
  Branch (148:17): [True: 0, False: 0]
  Branch (148:17): [True: 0, False: 0]
  Branch (148:17): [True: 0, False: 0]
149
1.45M
                T* src = direct_ptr(0);
150
1.45M
                T* dst = reinterpret_cast<T*>(new_indirect);
151
1.45M
                memcpy(dst, src, size() * sizeof(T));
152
1.45M
                _union.indirect_contents.indirect = new_indirect;
153
1.45M
                _union.indirect_contents.capacity = new_capacity;
154
1.45M
                _size += N + 1;
155
1.45M
            }
156
1.45M
        }
157
65.8M
    }
prevector<36u, unsigned char, unsigned int, int>::change_capacity(unsigned int)
Line
Count
Source
128
57.6M
    void change_capacity(size_type new_capacity) {
129
57.6M
        if (new_capacity <= N) {
  Branch (129:13): [True: 56.2M, False: 1.32M]
130
56.2M
            if (!is_direct()) {
  Branch (130:17): [True: 0, False: 56.2M]
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
56.2M
        } else {
139
1.32M
            if (!is_direct()) {
  Branch (139:17): [True: 84, False: 1.32M]
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
84
                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
144
84
                assert(_union.indirect_contents.indirect);
  Branch (144:17): [True: 84, False: 0]
145
84
                _union.indirect_contents.capacity = new_capacity;
146
1.32M
            } else {
147
1.32M
                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
148
1.32M
                assert(new_indirect);
  Branch (148:17): [True: 1.32M, False: 18.4E]
149
1.32M
                T* src = direct_ptr(0);
150
1.32M
                T* dst = reinterpret_cast<T*>(new_indirect);
151
1.32M
                memcpy(dst, src, size() * sizeof(T));
152
1.32M
                _union.indirect_contents.indirect = new_indirect;
153
1.32M
                _union.indirect_contents.capacity = new_capacity;
154
1.32M
                _size += N + 1;
155
1.32M
            }
156
1.32M
        }
157
57.6M
    }
prevector<16u, unsigned char, unsigned int, int>::change_capacity(unsigned int)
Line
Count
Source
128
8.23M
    void change_capacity(size_type new_capacity) {
129
8.23M
        if (new_capacity <= N) {
  Branch (129:13): [True: 8.09M, False: 133k]
130
8.09M
            if (!is_direct()) {
  Branch (130:17): [True: 0, False: 8.09M]
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
8.09M
        } else {
139
133k
            if (!is_direct()) {
  Branch (139:17): [True: 0, False: 133k]
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
133k
            } else {
147
133k
                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
148
133k
                assert(new_indirect);
  Branch (148:17): [True: 133k, False: 18.4E]
149
133k
                T* src = direct_ptr(0);
150
133k
                T* dst = reinterpret_cast<T*>(new_indirect);
151
133k
                memcpy(dst, src, size() * sizeof(T));
152
133k
                _union.indirect_contents.indirect = new_indirect;
153
133k
                _union.indirect_contents.capacity = new_capacity;
154
133k
                _size += N + 1;
155
133k
            }
156
133k
        }
157
8.23M
    }
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::change_capacity(unsigned int)
prevector<33u, unsigned char, unsigned int, int>::change_capacity(unsigned int)
Line
Count
Source
128
1.40k
    void change_capacity(size_type new_capacity) {
129
1.40k
        if (new_capacity <= N) {
  Branch (129:13): [True: 1.40k, False: 0]
130
1.40k
            if (!is_direct()) {
  Branch (130:17): [True: 0, False: 1.40k]
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.40k
        } 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
1.40k
    }
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::change_capacity(unsigned int)
158
159
48.6M
    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
prevector<36u, unsigned char, unsigned int, int>::item_ptr(int)
Line
Count
Source
159
36.1M
    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  Branch (159:47): [True: 34.8M, False: 1.33M]
prevector<16u, unsigned char, unsigned int, int>::item_ptr(int)
Line
Count
Source
159
12.4M
    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  Branch (159:47): [True: 12.1M, False: 247k]
prevector<33u, unsigned char, unsigned int, int>::item_ptr(int)
Line
Count
Source
159
95.0k
    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  Branch (159:47): [True: 95.0k, False: 0]
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::item_ptr(int)
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::item_ptr(int)
  Branch (159:47): [True: 34.8M, False: 1.33M]
  Branch (159:47): [True: 12.1M, False: 247k]
  Branch (159:47): [True: 95.0k, False: 0]
  Branch (159:47): [True: 0, False: 0]
  Branch (159:47): [True: 0, False: 0]
160
306M
    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
prevector<36u, unsigned char, unsigned int, int>::item_ptr(int) const
Line
Count
Source
160
232M
    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  Branch (160:59): [True: 220M, False: 12.2M]
prevector<16u, unsigned char, unsigned int, int>::item_ptr(int) const
Line
Count
Source
160
73.4M
    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  Branch (160:59): [True: 72.9M, False: 542k]
prevector<33u, unsigned char, unsigned int, int>::item_ptr(int) const
Line
Count
Source
160
1.40k
    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  Branch (160:59): [True: 1.40k, False: 0]
  Branch (160:59): [True: 220M, False: 12.2M]
  Branch (160:59): [True: 72.9M, False: 542k]
  Branch (160:59): [True: 1.40k, False: 0]
161
162
3.09M
    void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
163
3.09M
        std::fill_n(dst, count, value);
164
3.09M
    }
prevector<36u, unsigned char, unsigned int, int>::fill(unsigned char*, long, unsigned char const&)
Line
Count
Source
162
194k
    void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
163
194k
        std::fill_n(dst, count, value);
164
194k
    }
prevector<16u, unsigned char, unsigned int, int>::fill(unsigned char*, long, unsigned char const&)
Line
Count
Source
162
2.87M
    void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
163
2.87M
        std::fill_n(dst, count, value);
164
2.87M
    }
prevector<33u, unsigned char, unsigned int, int>::fill(unsigned char*, long, unsigned char const&)
Line
Count
Source
162
24.4k
    void fill(T* dst, ptrdiff_t count, const T& value = T{}) {
163
24.4k
        std::fill_n(dst, count, value);
164
24.4k
    }
165
166
    template <std::input_iterator InputIterator>
167
28.5M
    void fill(T* dst, InputIterator first, InputIterator last) {
168
30.6G
        while (first != last) {
  Branch (168:16): [True: 84, False: 42]
  Branch (168:16): [True: 455k, False: 76.0k]
  Branch (168:16): [True: 34.5M, False: 5.49M]
  Branch (168:16): [True: 30.5G, False: 20.6M]
  Branch (168:16): [True: 425k, False: 25.6k]
  Branch (168:16): [True: 2.15M, False: 1.53M]
  Branch (168:16): [True: 2.36M, False: 261k]
  Branch (168:16): [True: 0, False: 0]
  Branch (168:16): [True: 0, False: 0]
  Branch (168:16): [True: 2.13M, False: 534k]
  Branch (168:16): [True: 0, False: 0]
  Branch (168:16): [True: 0, False: 0]
  Branch (168:16): [True: 0, False: 0]
  Branch (168:16): [True: 0, False: 0]
169
30.6G
            new(static_cast<void*>(dst)) T(*first);
170
30.6G
            ++dst;
171
30.6G
            ++first;
172
30.6G
        }
173
28.5M
    }
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorPKhEEvPhT_S5_
Line
Count
Source
167
42
    void fill(T* dst, InputIterator first, InputIterator last) {
168
126
        while (first != last) {
  Branch (168:16): [True: 84, False: 42]
169
84
            new(static_cast<void*>(dst)) T(*first);
170
84
            ++dst;
171
84
            ++first;
172
84
        }
173
42
    }
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvPhT_SA_
Line
Count
Source
167
76.0k
    void fill(T* dst, InputIterator first, InputIterator last) {
168
531k
        while (first != last) {
  Branch (168:16): [True: 455k, False: 76.0k]
169
455k
            new(static_cast<void*>(dst)) T(*first);
170
455k
            ++dst;
171
455k
            ++first;
172
455k
        }
173
76.0k
    }
_ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorNS0_14const_iteratorEEEvPhT_S4_
Line
Count
Source
167
5.49M
    void fill(T* dst, InputIterator first, InputIterator last) {
168
40.0M
        while (first != last) {
  Branch (168:16): [True: 34.5M, False: 5.49M]
169
34.5M
            new(static_cast<void*>(dst)) T(*first);
170
34.5M
            ++dst;
171
34.5M
            ++first;
172
34.5M
        }
173
5.49M
    }
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorNS0_14const_iteratorEEEvPhT_S4_
Line
Count
Source
167
20.6M
    void fill(T* dst, InputIterator first, InputIterator last) {
168
30.6G
        while (first != last) {
  Branch (168:16): [True: 30.5G, False: 20.6M]
169
30.5G
            new(static_cast<void*>(dst)) T(*first);
170
30.5G
            ++dst;
171
30.5G
            ++first;
172
30.5G
        }
173
20.6M
    }
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEEvS4_T_S9_
Line
Count
Source
167
25.6k
    void fill(T* dst, InputIterator first, InputIterator last) {
168
450k
        while (first != last) {
  Branch (168:16): [True: 425k, False: 25.6k]
169
425k
            new(static_cast<void*>(dst)) T(*first);
170
425k
            ++dst;
171
425k
            ++first;
172
425k
        }
173
25.6k
    }
_ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEEvPhT_SB_
Line
Count
Source
167
1.53M
    void fill(T* dst, InputIterator first, InputIterator last) {
168
3.68M
        while (first != last) {
  Branch (168:16): [True: 2.15M, False: 1.53M]
169
2.15M
            new(static_cast<void*>(dst)) T(*first);
170
2.15M
            ++dst;
171
2.15M
            ++first;
172
2.15M
        }
173
1.53M
    }
_ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvPhT_SA_
Line
Count
Source
167
261k
    void fill(T* dst, InputIterator first, InputIterator last) {
168
2.62M
        while (first != last) {
  Branch (168:16): [True: 2.36M, False: 261k]
169
2.36M
            new(static_cast<void*>(dst)) T(*first);
170
2.36M
            ++dst;
171
2.36M
            ++first;
172
2.36M
        }
173
261k
    }
Unexecuted instantiation: _ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorPhEEvS2_T_S3_
Unexecuted instantiation: _ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEEvS4_T_S9_
_ZN9prevectorILj16EhjiE4fillITkSt14input_iteratorPKhEEvPhT_S5_
Line
Count
Source
167
534k
    void fill(T* dst, InputIterator first, InputIterator last) {
168
2.67M
        while (first != last) {
  Branch (168:16): [True: 2.13M, False: 534k]
169
2.13M
            new(static_cast<void*>(dst)) T(*first);
170
2.13M
            ++dst;
171
2.13M
            ++first;
172
2.13M
        }
173
534k
    }
Unexecuted instantiation: _ZN9prevectorILj35EhjiE4fillITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvPhT_SA_
Unexecuted instantiation: _ZN9prevectorILj35EhjiE4fillITkSt14input_iteratorPhEEvS2_T_S3_
Unexecuted instantiation: _ZN9prevectorILj35EhjiE4fillITkSt14input_iteratorPKhEEvPhT_S5_
Unexecuted instantiation: _ZN9prevectorILj36EhjiE4fillITkSt14input_iteratorNS0_8iteratorEEEvPhT_S4_
174
175
public:
176
135k
    void assign(size_type n, const T& val) {
177
135k
        clear();
178
135k
        if (capacity() < n) {
  Branch (178:13): [True: 0, False: 135k]
179
0
            change_capacity(n);
180
0
        }
181
135k
        _size += n;
182
135k
        fill(item_ptr(0), n, val);
183
135k
    }
184
185
    template <std::input_iterator InputIterator>
186
796k
    void assign(InputIterator first, InputIterator last) {
187
796k
        size_type n = last - first;
188
796k
        clear();
189
796k
        if (capacity() < n) {
  Branch (189:13): [True: 0, False: 293]
  Branch (189:13): [True: 297, False: 27]
  Branch (189:13): [True: 0, False: 261k]
  Branch (189:13): [True: 0, False: 0]
  Branch (189:13): [True: 0, False: 0]
  Branch (189:13): [True: 0, False: 533k]
190
297
            change_capacity(n);
191
297
        }
192
796k
        _size += n;
193
796k
        fill(item_ptr(0), first, last);
194
796k
    }
_ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorNS0_14const_iteratorEEEvT_S3_
Line
Count
Source
186
293
    void assign(InputIterator first, InputIterator last) {
187
293
        size_type n = last - first;
188
293
        clear();
189
293
        if (capacity() < n) {
  Branch (189:13): [True: 0, False: 293]
190
0
            change_capacity(n);
191
0
        }
192
293
        _size += n;
193
293
        fill(item_ptr(0), first, last);
194
293
    }
_ZN9prevectorILj36EhjiE6assignITkSt14input_iteratorNS0_14const_iteratorEEEvT_S3_
Line
Count
Source
186
324
    void assign(InputIterator first, InputIterator last) {
187
324
        size_type n = last - first;
188
324
        clear();
189
324
        if (capacity() < n) {
  Branch (189:13): [True: 297, False: 27]
190
297
            change_capacity(n);
191
297
        }
192
324
        _size += n;
193
324
        fill(item_ptr(0), first, last);
194
324
    }
_ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvT_S9_
Line
Count
Source
186
261k
    void assign(InputIterator first, InputIterator last) {
187
261k
        size_type n = last - first;
188
261k
        clear();
189
261k
        if (capacity() < n) {
  Branch (189:13): [True: 0, False: 261k]
190
0
            change_capacity(n);
191
0
        }
192
261k
        _size += n;
193
261k
        fill(item_ptr(0), first, last);
194
261k
    }
Unexecuted instantiation: _ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorPhEEvT_S3_
Unexecuted instantiation: _ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEEvT_S9_
_ZN9prevectorILj16EhjiE6assignITkSt14input_iteratorPKhEEvT_S4_
Line
Count
Source
186
533k
    void assign(InputIterator first, InputIterator last) {
187
533k
        size_type n = last - first;
188
533k
        clear();
189
533k
        if (capacity() < n) {
  Branch (189:13): [True: 0, False: 533k]
190
0
            change_capacity(n);
191
0
        }
192
533k
        _size += n;
193
533k
        fill(item_ptr(0), first, last);
194
533k
    }
195
196
67.9M
    prevector() = default;
prevector<36u, unsigned char, unsigned int, int>::prevector()
Line
Count
Source
196
37.6M
    prevector() = default;
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::prevector()
prevector<33u, unsigned char, unsigned int, int>::prevector()
Line
Count
Source
196
30.2M
    prevector() = default;
197
198
    explicit prevector(size_type n) {
199
        resize(n);
200
    }
201
202
2.61M
    explicit prevector(size_type n, const T& val) {
203
2.61M
        change_capacity(n);
204
2.61M
        _size += n;
205
2.61M
        fill(item_ptr(0), n, val);
206
2.61M
    }
prevector<33u, unsigned char, unsigned int, int>::prevector(unsigned int, unsigned char const&)
Line
Count
Source
202
1.40k
    explicit prevector(size_type n, const T& val) {
203
1.40k
        change_capacity(n);
204
1.40k
        _size += n;
205
1.40k
        fill(item_ptr(0), n, val);
206
1.40k
    }
prevector<16u, unsigned char, unsigned int, int>::prevector(unsigned int, unsigned char const&)
Line
Count
Source
202
2.60M
    explicit prevector(size_type n, const T& val) {
203
2.60M
        change_capacity(n);
204
2.60M
        _size += n;
205
2.60M
        fill(item_ptr(0), n, val);
206
2.60M
    }
207
208
    template <std::input_iterator InputIterator>
209
1.56M
    prevector(InputIterator first, InputIterator last) {
210
1.56M
        size_type n = last - first;
211
1.56M
        change_capacity(n);
212
1.56M
        _size += n;
213
1.56M
        fill(item_ptr(0), first, last);
214
1.56M
    }
_ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEET_S9_
Line
Count
Source
209
25.6k
    prevector(InputIterator first, InputIterator last) {
210
25.6k
        size_type n = last - first;
211
25.6k
        change_capacity(n);
212
25.6k
        _size += n;
213
25.6k
        fill(item_ptr(0), first, last);
214
25.6k
    }
_ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt6vectorIhSaIhEEEEEET_SA_
Line
Count
Source
209
1.53M
    prevector(InputIterator first, InputIterator last) {
210
1.53M
        size_type n = last - first;
211
1.53M
        change_capacity(n);
212
1.53M
        _size += n;
213
1.53M
        fill(item_ptr(0), first, last);
214
1.53M
    }
Unexecuted instantiation: _ZN9prevectorILj35EhjiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEET_S9_
Unexecuted instantiation: _ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEET_S9_
_ZN9prevectorILj36EhjiEC2ITkSt14input_iteratorNS0_14const_iteratorEEET_S3_
Line
Count
Source
209
4.73k
    prevector(InputIterator first, InputIterator last) {
210
4.73k
        size_type n = last - first;
211
4.73k
        change_capacity(n);
212
4.73k
        _size += n;
213
4.73k
        fill(item_ptr(0), first, last);
214
4.73k
    }
215
216
26.0M
    prevector(const prevector<N, T, Size, Diff>& other) {
217
26.0M
        size_type n = other.size();
218
26.0M
        change_capacity(n);
219
26.0M
        _size += n;
220
26.0M
        fill(item_ptr(0), other.begin(),  other.end());
221
26.0M
    }
prevector<16u, unsigned char, unsigned int, int>::prevector(prevector<16u, unsigned char, unsigned int, int> const&)
Line
Count
Source
216
5.47M
    prevector(const prevector<N, T, Size, Diff>& other) {
217
5.47M
        size_type n = other.size();
218
5.47M
        change_capacity(n);
219
5.47M
        _size += n;
220
5.47M
        fill(item_ptr(0), other.begin(),  other.end());
221
5.47M
    }
prevector<36u, unsigned char, unsigned int, int>::prevector(prevector<36u, unsigned char, unsigned int, int> const&)
Line
Count
Source
216
20.6M
    prevector(const prevector<N, T, Size, Diff>& other) {
217
20.6M
        size_type n = other.size();
218
20.6M
        change_capacity(n);
219
20.6M
        _size += n;
220
20.6M
        fill(item_ptr(0), other.begin(),  other.end());
221
20.6M
    }
222
223
    prevector(prevector<N, T, Size, Diff>&& other) noexcept
224
2.20M
        : _union(std::move(other._union)), _size(other._size)
225
2.20M
    {
226
2.20M
        other._size = 0;
227
2.20M
    }
prevector<16u, unsigned char, unsigned int, int>::prevector(prevector<16u, unsigned char, unsigned int, int>&&)
Line
Count
Source
224
1.36M
        : _union(std::move(other._union)), _size(other._size)
225
1.36M
    {
226
1.36M
        other._size = 0;
227
1.36M
    }
prevector<36u, unsigned char, unsigned int, int>::prevector(prevector<36u, unsigned char, unsigned int, int>&&)
Line
Count
Source
224
832k
        : _union(std::move(other._union)), _size(other._size)
225
832k
    {
226
832k
        other._size = 0;
227
832k
    }
228
229
617
    prevector& operator=(const prevector<N, T, Size, Diff>& other) {
230
617
        if (&other == this) {
  Branch (230:13): [True: 0, False: 293]
  Branch (230:13): [True: 0, False: 324]
231
0
            return *this;
232
0
        }
233
617
        assign(other.begin(), other.end());
234
617
        return *this;
235
617
    }
prevector<16u, unsigned char, unsigned int, int>::operator=(prevector<16u, unsigned char, unsigned int, int> const&)
Line
Count
Source
229
293
    prevector& operator=(const prevector<N, T, Size, Diff>& other) {
230
293
        if (&other == this) {
  Branch (230:13): [True: 0, False: 293]
231
0
            return *this;
232
0
        }
233
293
        assign(other.begin(), other.end());
234
293
        return *this;
235
293
    }
prevector<36u, unsigned char, unsigned int, int>::operator=(prevector<36u, unsigned char, unsigned int, int> const&)
Line
Count
Source
229
324
    prevector& operator=(const prevector<N, T, Size, Diff>& other) {
230
324
        if (&other == this) {
  Branch (230:13): [True: 0, False: 324]
231
0
            return *this;
232
0
        }
233
324
        assign(other.begin(), other.end());
234
324
        return *this;
235
324
    }
236
237
21.0M
    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
238
21.0M
        if (!is_direct()) {
  Branch (238:13): [True: 71, False: 18.7M]
  Branch (238:13): [True: 63, False: 2.27M]
239
134
            free(_union.indirect_contents.indirect);
240
134
        }
241
21.0M
        _union = std::move(other._union);
242
21.0M
        _size = other._size;
243
21.0M
        other._size = 0;
244
21.0M
        return *this;
245
21.0M
    }
prevector<36u, unsigned char, unsigned int, int>::operator=(prevector<36u, unsigned char, unsigned int, int>&&)
Line
Count
Source
237
18.7M
    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
238
18.7M
        if (!is_direct()) {
  Branch (238:13): [True: 71, False: 18.7M]
239
71
            free(_union.indirect_contents.indirect);
240
71
        }
241
18.7M
        _union = std::move(other._union);
242
18.7M
        _size = other._size;
243
18.7M
        other._size = 0;
244
18.7M
        return *this;
245
18.7M
    }
prevector<16u, unsigned char, unsigned int, int>::operator=(prevector<16u, unsigned char, unsigned int, int>&&)
Line
Count
Source
237
2.27M
    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
238
2.27M
        if (!is_direct()) {
  Branch (238:13): [True: 63, False: 2.27M]
239
63
            free(_union.indirect_contents.indirect);
240
63
        }
241
2.27M
        _union = std::move(other._union);
242
2.27M
        _size = other._size;
243
2.27M
        other._size = 0;
244
2.27M
        return *this;
245
2.27M
    }
246
247
724M
    size_type size() const {
248
724M
        return is_direct() ? _size : _size - N - 1;
  Branch (248:16): [True: 650M, False: 23.2M]
  Branch (248:16): [True: 51.1M, False: 382k]
  Branch (248:16): [True: 47.5k, False: 0]
  Branch (248:16): [True: 0, False: 0]
  Branch (248:16): [True: 0, False: 0]
249
724M
    }
prevector<36u, unsigned char, unsigned int, int>::size() const
Line
Count
Source
247
673M
    size_type size() const {
248
673M
        return is_direct() ? _size : _size - N - 1;
  Branch (248:16): [True: 650M, False: 23.2M]
249
673M
    }
prevector<16u, unsigned char, unsigned int, int>::size() const
Line
Count
Source
247
51.5M
    size_type size() const {
248
51.5M
        return is_direct() ? _size : _size - N - 1;
  Branch (248:16): [True: 51.1M, False: 382k]
249
51.5M
    }
prevector<33u, unsigned char, unsigned int, int>::size() const
Line
Count
Source
247
47.5k
    size_type size() const {
248
47.5k
        return is_direct() ? _size : _size - N - 1;
  Branch (248:16): [True: 47.5k, False: 0]
249
47.5k
    }
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::size() const
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::size() const
250
251
95.4M
    bool empty() const {
252
95.4M
        return size() == 0;
253
95.4M
    }
prevector<36u, unsigned char, unsigned int, int>::empty() const
Line
Count
Source
251
94.2M
    bool empty() const {
252
94.2M
        return size() == 0;
253
94.2M
    }
prevector<16u, unsigned char, unsigned int, int>::empty() const
Line
Count
Source
251
1.16M
    bool empty() const {
252
1.16M
        return size() == 0;
253
1.16M
    }
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::empty() const
254
255
252k
    iterator begin() { return iterator(item_ptr(0)); }
prevector<36u, unsigned char, unsigned int, int>::begin()
Line
Count
Source
255
252k
    iterator begin() { return iterator(item_ptr(0)); }
Unexecuted instantiation: prevector<16u, unsigned char, unsigned int, int>::begin()
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::begin()
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::begin()
256
90.8M
    const_iterator begin() const { return const_iterator(item_ptr(0)); }
prevector<36u, unsigned char, unsigned int, int>::begin() const
Line
Count
Source
256
62.6M
    const_iterator begin() const { return const_iterator(item_ptr(0)); }
prevector<16u, unsigned char, unsigned int, int>::begin() const
Line
Count
Source
256
28.2M
    const_iterator begin() const { return const_iterator(item_ptr(0)); }
257
6.29M
    iterator end() { return iterator(item_ptr(size())); }
prevector<36u, unsigned char, unsigned int, int>::end()
Line
Count
Source
257
4.33M
    iterator end() { return iterator(item_ptr(size())); }
prevector<16u, unsigned char, unsigned int, int>::end()
Line
Count
Source
257
1.95M
    iterator end() { return iterator(item_ptr(size())); }
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::end()
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::end()
258
68.5M
    const_iterator end() const { return const_iterator(item_ptr(size())); }
prevector<36u, unsigned char, unsigned int, int>::end() const
Line
Count
Source
258
60.6M
    const_iterator end() const { return const_iterator(item_ptr(size())); }
prevector<16u, unsigned char, unsigned int, int>::end() const
Line
Count
Source
258
7.90M
    const_iterator end() const { return const_iterator(item_ptr(size())); }
259
260
6.79M
    size_t capacity() const {
261
6.79M
        if (is_direct()) {
  Branch (261:13): [True: 5.70M, False: 2.30k]
  Branch (261:13): [True: 1.06M, False: 0]
  Branch (261:13): [True: 0, False: 0]
  Branch (261:13): [True: 23.0k, False: 0]
  Branch (261:13): [True: 0, False: 0]
262
6.79M
            return N;
263
6.79M
        } else {
264
2.30k
            return _union.indirect_contents.capacity;
265
2.30k
        }
266
6.79M
    }
prevector<36u, unsigned char, unsigned int, int>::capacity() const
Line
Count
Source
260
5.70M
    size_t capacity() const {
261
5.70M
        if (is_direct()) {
  Branch (261:13): [True: 5.70M, False: 2.30k]
262
5.70M
            return N;
263
5.70M
        } else {
264
2.30k
            return _union.indirect_contents.capacity;
265
2.30k
        }
266
5.70M
    }
prevector<16u, unsigned char, unsigned int, int>::capacity() const
Line
Count
Source
260
1.06M
    size_t capacity() const {
261
1.06M
        if (is_direct()) {
  Branch (261:13): [True: 1.06M, False: 0]
262
1.06M
            return N;
263
1.06M
        } else {
264
0
            return _union.indirect_contents.capacity;
265
0
        }
266
1.06M
    }
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::capacity() const
prevector<33u, unsigned char, unsigned int, int>::capacity() const
Line
Count
Source
260
23.0k
    size_t capacity() const {
261
23.0k
        if (is_direct()) {
  Branch (261:13): [True: 23.0k, False: 0]
262
23.0k
            return N;
263
23.0k
        } else {
264
0
            return _union.indirect_contents.capacity;
265
0
        }
266
23.0k
    }
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::capacity() const
267
268
5.91M
    T& operator[](size_type pos) {
269
5.91M
        return *item_ptr(pos);
270
5.91M
    }
prevector<36u, unsigned char, unsigned int, int>::operator[](unsigned int)
Line
Count
Source
268
5.87M
    T& operator[](size_type pos) {
269
5.87M
        return *item_ptr(pos);
270
5.87M
    }
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::operator[](unsigned int)
prevector<33u, unsigned char, unsigned int, int>::operator[](unsigned int)
Line
Count
Source
268
46.1k
    T& operator[](size_type pos) {
269
46.1k
        return *item_ptr(pos);
270
46.1k
    }
prevector<16u, unsigned char, unsigned int, int>::operator[](unsigned int)
Line
Count
Source
268
108
    T& operator[](size_type pos) {
269
108
        return *item_ptr(pos);
270
108
    }
271
272
50.3M
    const T& operator[](size_type pos) const {
273
50.3M
        return *item_ptr(pos);
274
50.3M
    }
prevector<36u, unsigned char, unsigned int, int>::operator[](unsigned int) const
Line
Count
Source
272
26.2M
    const T& operator[](size_type pos) const {
273
26.2M
        return *item_ptr(pos);
274
26.2M
    }
prevector<16u, unsigned char, unsigned int, int>::operator[](unsigned int) const
Line
Count
Source
272
24.1M
    const T& operator[](size_type pos) const {
273
24.1M
        return *item_ptr(pos);
274
24.1M
    }
275
276
45.1M
    void resize(size_type new_size) {
277
45.1M
        size_type cur_size = size();
278
45.1M
        if (cur_size == new_size) {
  Branch (278:13): [True: 41.6M, False: 2.24M]
  Branch (278:13): [True: 107k, False: 1.11M]
  Branch (278:13): [True: 0, False: 23.0k]
279
41.7M
            return;
280
41.7M
        }
281
3.37M
        if (cur_size > new_size) {
  Branch (281:13): [True: 2.04M, False: 194k]
  Branch (281:13): [True: 979k, False: 130k]
  Branch (281:13): [True: 0, False: 23.0k]
282
3.02M
            erase(item_ptr(new_size), end());
283
3.02M
            return;
284
3.02M
        }
285
348k
        if (new_size > capacity()) {
  Branch (285:13): [True: 0, False: 194k]
  Branch (285:13): [True: 130k, False: 18.4E]
  Branch (285:13): [True: 0, False: 23.0k]
286
130k
            change_capacity(new_size);
287
130k
        }
288
348k
        ptrdiff_t increase = new_size - cur_size;
289
348k
        fill(item_ptr(cur_size), increase);
290
348k
        _size += increase;
291
348k
    }
prevector<36u, unsigned char, unsigned int, int>::resize(unsigned int)
Line
Count
Source
276
43.8M
    void resize(size_type new_size) {
277
43.8M
        size_type cur_size = size();
278
43.8M
        if (cur_size == new_size) {
  Branch (278:13): [True: 41.6M, False: 2.24M]
279
41.6M
            return;
280
41.6M
        }
281
2.24M
        if (cur_size > new_size) {
  Branch (281:13): [True: 2.04M, False: 194k]
282
2.04M
            erase(item_ptr(new_size), end());
283
2.04M
            return;
284
2.04M
        }
285
194k
        if (new_size > capacity()) {
  Branch (285:13): [True: 0, False: 194k]
286
0
            change_capacity(new_size);
287
0
        }
288
194k
        ptrdiff_t increase = new_size - cur_size;
289
194k
        fill(item_ptr(cur_size), increase);
290
194k
        _size += increase;
291
194k
    }
prevector<16u, unsigned char, unsigned int, int>::resize(unsigned int)
Line
Count
Source
276
1.21M
    void resize(size_type new_size) {
277
1.21M
        size_type cur_size = size();
278
1.21M
        if (cur_size == new_size) {
  Branch (278:13): [True: 107k, False: 1.11M]
279
107k
            return;
280
107k
        }
281
1.11M
        if (cur_size > new_size) {
  Branch (281:13): [True: 979k, False: 130k]
282
979k
            erase(item_ptr(new_size), end());
283
979k
            return;
284
979k
        }
285
130k
        if (new_size > capacity()) {
  Branch (285:13): [True: 130k, False: 18.4E]
286
130k
            change_capacity(new_size);
287
130k
        }
288
130k
        ptrdiff_t increase = new_size - cur_size;
289
130k
        fill(item_ptr(cur_size), increase);
290
130k
        _size += increase;
291
130k
    }
prevector<33u, unsigned char, unsigned int, int>::resize(unsigned int)
Line
Count
Source
276
23.0k
    void resize(size_type new_size) {
277
23.0k
        size_type cur_size = size();
278
23.0k
        if (cur_size == new_size) {
  Branch (278:13): [True: 0, False: 23.0k]
279
0
            return;
280
0
        }
281
23.0k
        if (cur_size > new_size) {
  Branch (281:13): [True: 0, False: 23.0k]
282
0
            erase(item_ptr(new_size), end());
283
0
            return;
284
0
        }
285
23.0k
        if (new_size > capacity()) {
  Branch (285:13): [True: 0, False: 23.0k]
286
0
            change_capacity(new_size);
287
0
        }
288
23.0k
        ptrdiff_t increase = new_size - cur_size;
289
23.0k
        fill(item_ptr(cur_size), increase);
290
23.0k
        _size += increase;
291
23.0k
    }
292
293
    void reserve(size_type new_capacity) {
294
        if (new_capacity > capacity()) {
295
            change_capacity(new_capacity);
296
        }
297
    }
298
299
34.6M
    void shrink_to_fit() {
300
34.6M
        change_capacity(size());
301
34.6M
    }
302
303
44.6M
    void clear() {
304
44.6M
        resize(0);
305
44.6M
    }
prevector<36u, unsigned char, unsigned int, int>::clear()
Line
Count
Source
303
43.6M
    void clear() {
304
43.6M
        resize(0);
305
43.6M
    }
prevector<16u, unsigned char, unsigned int, int>::clear()
Line
Count
Source
303
934k
    void clear() {
304
934k
        resize(0);
305
934k
    }
306
307
77.4k
    iterator insert(iterator pos, const T& value) {
308
77.4k
        size_type p = pos - begin();
309
77.4k
        size_type new_size = size() + 1;
310
77.4k
        if (capacity() < new_size) {
  Branch (310:13): [True: 0, False: 77.4k]
311
0
            change_capacity(new_size + (new_size >> 1));
312
0
        }
313
77.4k
        T* ptr = item_ptr(p);
314
77.4k
        T* dst = ptr + 1;
315
77.4k
        memmove(dst, ptr, (size() - p) * sizeof(T));
316
77.4k
        _size++;
317
77.4k
        new(static_cast<void*>(ptr)) T(value);
318
77.4k
        return iterator(ptr);
319
77.4k
    }
320
321
    void insert(iterator pos, size_type count, const T& value) {
322
        size_type p = pos - begin();
323
        size_type new_size = size() + count;
324
        if (capacity() < new_size) {
325
            change_capacity(new_size + (new_size >> 1));
326
        }
327
        T* ptr = item_ptr(p);
328
        T* dst = ptr + count;
329
        memmove(dst, ptr, (size() - p) * sizeof(T));
330
        _size += count;
331
        fill(item_ptr(p), count, value);
332
    }
333
334
    template <std::input_iterator InputIterator>
335
96.4k
    void insert(iterator pos, InputIterator first, InputIterator last) {
336
96.4k
        size_type p = pos - begin();
337
96.4k
        difference_type count = last - first;
338
96.4k
        size_type new_size = size() + count;
339
96.4k
        if (capacity() < new_size) {
  Branch (339:13): [True: 0, False: 42]
  Branch (339:13): [True: 4.04k, False: 71.9k]
  Branch (339:13): [True: 0, False: 0]
  Branch (339:13): [True: 0, False: 0]
  Branch (339:13): [True: 0, False: 0]
  Branch (339:13): [True: 0, False: 0]
  Branch (339:13): [True: 241, False: 20.1k]
340
4.28k
            change_capacity(new_size + (new_size >> 1));
341
4.28k
        }
342
96.4k
        T* ptr = item_ptr(p);
343
96.4k
        T* dst = ptr + count;
344
96.4k
        memmove(dst, ptr, (size() - p) * sizeof(T));
345
96.4k
        _size += count;
346
96.4k
        fill(ptr, first, last);
347
96.4k
    }
_ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorPKhEEvNS0_8iteratorET_S5_
Line
Count
Source
335
42
    void insert(iterator pos, InputIterator first, InputIterator last) {
336
42
        size_type p = pos - begin();
337
42
        difference_type count = last - first;
338
42
        size_type new_size = size() + count;
339
42
        if (capacity() < new_size) {
  Branch (339:13): [True: 0, False: 42]
340
0
            change_capacity(new_size + (new_size >> 1));
341
0
        }
342
42
        T* ptr = item_ptr(p);
343
42
        T* dst = ptr + count;
344
42
        memmove(dst, ptr, (size() - p) * sizeof(T));
345
42
        _size += count;
346
42
        fill(ptr, first, last);
347
42
    }
_ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPKhSt4spanIS4_Lm18446744073709551615EEEEEEvNS0_8iteratorET_SA_
Line
Count
Source
335
76.0k
    void insert(iterator pos, InputIterator first, InputIterator last) {
336
76.0k
        size_type p = pos - begin();
337
76.0k
        difference_type count = last - first;
338
76.0k
        size_type new_size = size() + count;
339
76.0k
        if (capacity() < new_size) {
  Branch (339:13): [True: 4.04k, False: 71.9k]
340
4.04k
            change_capacity(new_size + (new_size >> 1));
341
4.04k
        }
342
76.0k
        T* ptr = item_ptr(p);
343
76.0k
        T* dst = ptr + count;
344
76.0k
        memmove(dst, ptr, (size() - p) * sizeof(T));
345
76.0k
        _size += count;
346
76.0k
        fill(ptr, first, last);
347
76.0k
    }
Unexecuted instantiation: _ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEEEvNS0_8iteratorET_SA_
Unexecuted instantiation: _ZN9prevectorILj35EhjiE6insertITkSt14input_iteratorPhEEvNS0_8iteratorET_S4_
Unexecuted instantiation: _ZN9prevectorILj35EhjiE6insertITkSt14input_iteratorPKhEEvNS0_8iteratorET_S5_
Unexecuted instantiation: _ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorNS0_8iteratorEEEvS2_T_S3_
_ZN9prevectorILj36EhjiE6insertITkSt14input_iteratorNS0_14const_iteratorEEEvNS0_8iteratorET_S4_
Line
Count
Source
335
20.3k
    void insert(iterator pos, InputIterator first, InputIterator last) {
336
20.3k
        size_type p = pos - begin();
337
20.3k
        difference_type count = last - first;
338
20.3k
        size_type new_size = size() + count;
339
20.3k
        if (capacity() < new_size) {
  Branch (339:13): [True: 241, False: 20.1k]
340
241
            change_capacity(new_size + (new_size >> 1));
341
241
        }
342
20.3k
        T* ptr = item_ptr(p);
343
20.3k
        T* dst = ptr + count;
344
20.3k
        memmove(dst, ptr, (size() - p) * sizeof(T));
345
20.3k
        _size += count;
346
20.3k
        fill(ptr, first, last);
347
20.3k
    }
348
349
5.33M
    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
5.33M
        if (capacity() < new_size) {
  Branch (352:13): [True: 770k, False: 4.56M]
353
770k
            change_capacity(new_size);
354
770k
            _size += new_size - size();
355
770k
            return;
356
770k
        }
357
4.56M
        if (new_size < size()) {
  Branch (357:13): [True: 0, False: 4.56M]
358
0
            erase(item_ptr(new_size), end());
359
4.56M
        } else {
360
4.56M
            _size += new_size - size();
361
4.56M
        }
362
4.56M
    }
363
364
    iterator erase(iterator pos) {
365
        return erase(pos, pos + 1);
366
    }
367
368
3.02M
    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
3.02M
        iterator p = first;
376
3.02M
        char* endp = (char*)&(*end());
377
3.02M
        _size -= last - p;
378
3.02M
        memmove(&(*first), &(*last), endp - ((char*)(&(*last))));
379
3.02M
        return first;
380
3.02M
    }
prevector<36u, unsigned char, unsigned int, int>::erase(prevector<36u, unsigned char, unsigned int, int>::iterator, prevector<36u, unsigned char, unsigned int, int>::iterator)
Line
Count
Source
368
2.04M
    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
2.04M
        iterator p = first;
376
2.04M
        char* endp = (char*)&(*end());
377
2.04M
        _size -= last - p;
378
2.04M
        memmove(&(*first), &(*last), endp - ((char*)(&(*last))));
379
2.04M
        return first;
380
2.04M
    }
prevector<16u, unsigned char, unsigned int, int>::erase(prevector<16u, unsigned char, unsigned int, int>::iterator, prevector<16u, unsigned char, unsigned int, int>::iterator)
Line
Count
Source
368
979k
    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
979k
        iterator p = first;
376
979k
        char* endp = (char*)&(*end());
377
979k
        _size -= last - p;
378
979k
        memmove(&(*first), &(*last), endp - ((char*)(&(*last))));
379
979k
        return first;
380
979k
    }
Unexecuted instantiation: prevector<33u, unsigned char, unsigned int, int>::erase(prevector<33u, unsigned char, unsigned int, int>::iterator, prevector<33u, unsigned char, unsigned int, int>::iterator)
381
382
    template<typename... Args>
383
0
    void emplace_back(Args&&... args) {
384
0
        size_type new_size = size() + 1;
385
0
        if (capacity() < new_size) {
  Branch (385:13): [True: 0, False: 0]
  Branch (385:13): [True: 0, False: 0]
386
0
            change_capacity(new_size + (new_size >> 1));
387
0
        }
388
0
        new(item_ptr(size())) T(std::forward<Args>(args)...);
389
0
        _size++;
390
0
    }
Unexecuted instantiation: void prevector<36u, unsigned char, unsigned int, int>::emplace_back<unsigned char const&>(unsigned char const&)
Unexecuted instantiation: void prevector<4u, Network, unsigned int, int>::emplace_back<Network const&>(Network const&)
391
392
0
    void push_back(const T& value) {
393
0
        emplace_back(value);
394
0
    }
Unexecuted instantiation: prevector<36u, unsigned char, unsigned int, int>::push_back(unsigned char const&)
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::push_back(Network const&)
395
396
    void pop_back() {
397
        erase(end() - 1, end());
398
    }
399
400
    T& front() {
401
        return *item_ptr(0);
402
    }
403
404
    const T& front() const {
405
        return *item_ptr(0);
406
    }
407
408
    T& back() {
409
        return *item_ptr(size() - 1);
410
    }
411
412
28.8k
    const T& back() const {
413
28.8k
        return *item_ptr(size() - 1);
414
28.8k
    }
415
416
    void swap(prevector<N, T, Size, Diff>& other) noexcept
417
    {
418
        std::swap(_union, other._union);
419
        std::swap(_size, other._size);
420
    }
421
422
158M
    ~prevector() {
423
158M
        if (!is_direct()) {
  Branch (423:13): [True: 1.47M, False: 114M]
  Branch (423:13): [True: 133k, False: 12.9M]
  Branch (423:13): [True: 0, False: 0]
  Branch (423:13): [True: 0, False: 30.2M]
  Branch (423:13): [True: 0, False: 0]
424
1.60M
            free(_union.indirect_contents.indirect);
425
1.60M
            _union.indirect_contents.indirect = nullptr;
426
1.60M
        }
427
158M
    }
prevector<36u, unsigned char, unsigned int, int>::~prevector()
Line
Count
Source
422
115M
    ~prevector() {
423
115M
        if (!is_direct()) {
  Branch (423:13): [True: 1.47M, False: 114M]
424
1.47M
            free(_union.indirect_contents.indirect);
425
1.47M
            _union.indirect_contents.indirect = nullptr;
426
1.47M
        }
427
115M
    }
prevector<16u, unsigned char, unsigned int, int>::~prevector()
Line
Count
Source
422
13.0M
    ~prevector() {
423
13.0M
        if (!is_direct()) {
  Branch (423:13): [True: 133k, False: 12.9M]
424
133k
            free(_union.indirect_contents.indirect);
425
133k
            _union.indirect_contents.indirect = nullptr;
426
133k
        }
427
13.0M
    }
Unexecuted instantiation: prevector<4u, Network, unsigned int, int>::~prevector()
prevector<33u, unsigned char, unsigned int, int>::~prevector()
Line
Count
Source
422
30.2M
    ~prevector() {
423
30.2M
        if (!is_direct()) {
  Branch (423:13): [True: 0, False: 30.2M]
424
0
            free(_union.indirect_contents.indirect);
425
0
            _union.indirect_contents.indirect = nullptr;
426
0
        }
427
30.2M
    }
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::~prevector()
428
429
1.26M
    constexpr bool operator==(const prevector& other) const {
430
1.26M
        return std::ranges::equal(*this, other);
431
1.26M
    }
prevector<36u, unsigned char, unsigned int, int>::operator==(prevector<36u, unsigned char, unsigned int, int> const&) const
Line
Count
Source
429
537k
    constexpr bool operator==(const prevector& other) const {
430
537k
        return std::ranges::equal(*this, other);
431
537k
    }
prevector<16u, unsigned char, unsigned int, int>::operator==(prevector<16u, unsigned char, unsigned int, int> const&) const
Line
Count
Source
429
722k
    constexpr bool operator==(const prevector& other) const {
430
722k
        return std::ranges::equal(*this, other);
431
722k
    }
432
433
568k
    bool operator<(const prevector<N, T, Size, Diff>& other) const {
434
568k
        if (size() < other.size()) {
  Branch (434:13): [True: 0, False: 0]
  Branch (434:13): [True: 0, False: 568k]
435
0
            return true;
436
0
        }
437
568k
        if (size() > other.size()) {
  Branch (437:13): [True: 0, False: 0]
  Branch (437:13): [True: 0, False: 568k]
438
0
            return false;
439
0
        }
440
568k
        const_iterator b1 = begin();
441
568k
        const_iterator b2 = other.begin();
442
568k
        const_iterator e1 = end();
443
2.84M
        while (b1 != e1) {
  Branch (443:16): [True: 0, False: 0]
  Branch (443:16): [True: 2.27M, False: 568k]
444
2.27M
            if ((*b1) < (*b2)) {
  Branch (444:17): [True: 0, False: 0]
  Branch (444:17): [True: 0, False: 2.27M]
445
0
                return true;
446
0
            }
447
2.27M
            if ((*b2) < (*b1)) {
  Branch (447:17): [True: 0, False: 0]
  Branch (447:17): [True: 0, False: 2.27M]
448
0
                return false;
449
0
            }
450
2.27M
            ++b1;
451
2.27M
            ++b2;
452
2.27M
        }
453
568k
        return false;
454
568k
    }
Unexecuted instantiation: prevector<36u, unsigned char, unsigned int, int>::operator<(prevector<36u, unsigned char, unsigned int, int> const&) const
prevector<16u, unsigned char, unsigned int, int>::operator<(prevector<16u, unsigned char, unsigned int, int> const&) const
Line
Count
Source
433
568k
    bool operator<(const prevector<N, T, Size, Diff>& other) const {
434
568k
        if (size() < other.size()) {
  Branch (434:13): [True: 0, False: 568k]
435
0
            return true;
436
0
        }
437
568k
        if (size() > other.size()) {
  Branch (437:13): [True: 0, False: 568k]
438
0
            return false;
439
0
        }
440
568k
        const_iterator b1 = begin();
441
568k
        const_iterator b2 = other.begin();
442
568k
        const_iterator e1 = end();
443
2.84M
        while (b1 != e1) {
  Branch (443:16): [True: 2.27M, False: 568k]
444
2.27M
            if ((*b1) < (*b2)) {
  Branch (444:17): [True: 0, False: 2.27M]
445
0
                return true;
446
0
            }
447
2.27M
            if ((*b2) < (*b1)) {
  Branch (447:17): [True: 0, False: 2.27M]
448
0
                return false;
449
0
            }
450
2.27M
            ++b1;
451
2.27M
            ++b2;
452
2.27M
        }
453
568k
        return false;
454
568k
    }
455
456
37.9M
    size_t allocated_memory() const {
457
37.9M
        if (is_direct()) {
  Branch (457:13): [True: 37.6M, False: 270k]
458
37.6M
            return 0;
459
37.6M
        } else {
460
270k
            return ((size_t)(sizeof(T))) * _union.indirect_contents.capacity;
461
270k
        }
462
37.9M
    }
463
464
1.40M
    value_type* data() {
465
1.40M
        return item_ptr(0);
466
1.40M
    }
prevector<16u, unsigned char, unsigned int, int>::data()
Line
Count
Source
464
283k
    value_type* data() {
465
283k
        return item_ptr(0);
466
283k
    }
prevector<33u, unsigned char, unsigned int, int>::data()
Line
Count
Source
464
24.4k
    value_type* data() {
465
24.4k
        return item_ptr(0);
466
24.4k
    }
prevector<36u, unsigned char, unsigned int, int>::data()
Line
Count
Source
464
1.10M
    value_type* data() {
465
1.10M
        return item_ptr(0);
466
1.10M
    }
Unexecuted instantiation: prevector<35u, unsigned char, unsigned int, int>::data()
467
468
96.3M
    const value_type* data() const {
469
96.3M
        return item_ptr(0);
470
96.3M
    }
prevector<36u, unsigned char, unsigned int, int>::data() const
Line
Count
Source
468
83.2M
    const value_type* data() const {
469
83.2M
        return item_ptr(0);
470
83.2M
    }
prevector<16u, unsigned char, unsigned int, int>::data() const
Line
Count
Source
468
13.0M
    const value_type* data() const {
469
13.0M
        return item_ptr(0);
470
13.0M
    }
prevector<33u, unsigned char, unsigned int, int>::data() const
Line
Count
Source
468
1.40k
    const value_type* data() const {
469
1.40k
        return item_ptr(0);
470
1.40k
    }
471
};
472
473
#endif // BITCOIN_PREVECTOR_H