We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01f3b1a commit 9fa65aeCopy full SHA for 9fa65ae
obj_gen.cpp
@@ -244,20 +244,20 @@ void object_generator::alloc_value_buffer(void)
244
char *d = m_value_buffer;
245
int ret;
246
int iter = 0;
247
-
248
while (d - m_value_buffer < size) {
249
if (buf1_idx == sizeof(buf1)) {
250
buf1_idx = 0;
251
buf2_idx++;
+
252
if (buf2_idx >= sizeof(buf2)) {
253
- iter++;
254
- if (iter == 20) {
+ if (iter % 20 == 0) {
255
ret = read(m_random_fd, buf1, sizeof(buf1));
256
assert(ret > -1);
257
ret = read(m_random_fd, buf2, sizeof(buf2));
258
259
- buf1_idx = buf2_idx = iter = 0;
260
}
+ buf2_idx = 0;
+ iter++;
261
262
263
*d = buf1[buf1_idx] ^ buf2[buf2_idx] ^ iter;
0 commit comments