n_enqueued = count_trailing_zeros (~bitmap) / 2;
#else
u16 x = 0;
- x |= next_index ^ nexts[1];
- x |= next_index ^ nexts[2];
- x |= next_index ^ nexts[3];
- n_enqueued = (x == 0) ? 4 : 1;
+ if (count + 3 < max)
+ {
+ x |= next_index ^ nexts[1];
+ x |= next_index ^ nexts[2];
+ x |= next_index ^ nexts[3];
+ n_enqueued = (x == 0) ? 4 : 1;
+ }
+ else
+ n_enqueued = 1;
#endif
if (PREDICT_FALSE (n_enqueued > max))
#endif
count += 2;
data += 2;
- while (count < max_count - 3 &&
+ while (count + 3 < max_count &&
((data[0] ^ first) | (data[1] ^ first) |
(data[2] ^ first) | (data[3] ^ first)) == 0)
{
#endif
count += 2;
data += 2;
- while (count < max_count - 3 &&
+ while (count + 3 < max_count &&
((data[0] ^ first) | (data[1] ^ first) |
(data[2] ^ first) | (data[3] ^ first)) == 0)
{
#endif
count += 2;
data += 2;
- while (count < max_count - 3 &&
+ while (count + 3 < max_count &&
((data[0] ^ first) | (data[1] ^ first) |
(data[2] ^ first) | (data[3] ^ first)) == 0)
{
#endif
count += 2;
data += 2;
- while (count < max_count - 3 &&
+ while (count + 3 < max_count &&
((data[0] ^ first) | (data[1] ^ first) |
(data[2] ^ first) | (data[3] ^ first)) == 0)
{