53 std::vector<int> reference;
55 for (
size_t i = 0; i < std::min(
size,
size_t{256}); ++i)
57 const uint8_t
byte = data[i];
58 const int value =
static_cast<int>(byte) - 128;
63 if (reference.size() < 64)
66 reference.push_back(
value);
70 if (not reference.empty())
72 if (array.
pop() != reference.back())
79 std::reverse(reference.begin(), reference.end());
82 if (not reference.empty())
84 const size_t index =
byte % reference.size();
86 reference[index] =
value;
90 if (not reference.empty())
92 const size_t new_size =
byte % (reference.size() + 1);
94 reference.resize(new_size);
99 if (array.
size() != reference.size())
101 for (
size_t j = 0; j < reference.size(); ++j)
102 if (array(j) != reference[j])
size_t size_t int32_t value
void cut(const size_t new_dim=0)
Cut the array to a new dimension; that is, it reduces the dimension of array and frees the remaining ...
DynArray & reverse()
Reverse the order of items in an array.
size_t size() const noexcept
Return the current dimension of array.
T pop()
Remove the last item of array (as if this was a stack)
T & append()
Allocate a new entry to the end of array.
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
Exercise bounded sequences of DynArray mutations.
size_t size(Node *root) noexcept
See compute_cardinality_rec(Node * root).
Lazy and scalable dynamic array implementation.