| line |
true |
false |
branch |
|
107
|
0 |
0 |
if (pid == 0) return 1; |
|
108
|
0 |
0 |
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH); |
|
|
0 |
0 |
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH); |
|
113
|
0 |
0 |
if (!__atomic_compare_exchange_n(&hdr->rwlock, &observed_rwlock, |
|
117
|
0 |
0 |
if (seq & 1) |
|
121
|
0 |
0 |
if (__atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0) |
|
132
|
0 |
1 |
if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) { |
|
|
0 |
0 |
if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) { |
|
133
|
0 |
0 |
if (__atomic_compare_exchange_n(lock, &cur, cur + 1, |
|
136
|
1 |
0 |
} else if (cur == 0 && !__atomic_load_n(waiters, __ATOMIC_RELAXED)) { |
|
|
1 |
0 |
} else if (cur == 0 && !__atomic_load_n(waiters, __ATOMIC_RELAXED)) { |
|
137
|
1 |
0 |
if (__atomic_compare_exchange_n(lock, &cur, 1, |
|
141
|
0 |
0 |
if (__builtin_expect(spin < BUF_RWLOCK_SPIN_LIMIT, 1)) { |
|
147
|
0 |
0 |
if (cur >= BUF_RWLOCK_WRITER_BIT || cur == 0) { |
|
|
0 |
0 |
if (cur >= BUF_RWLOCK_WRITER_BIT || cur == 0) { |
|
150
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT && cur >= BUF_RWLOCK_WRITER_BIT) { |
|
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT && cur >= BUF_RWLOCK_WRITER_BIT) { |
|
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT && cur >= BUF_RWLOCK_WRITER_BIT) { |
|
153
|
0 |
0 |
if (val >= BUF_RWLOCK_WRITER_BIT) { |
|
155
|
0 |
0 |
if (!buf_pid_alive(pid)) |
|
169
|
1 |
0 |
if (prev == 0 && __atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0) |
|
|
0 |
1 |
if (prev == 0 && __atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0) |
|
179
|
551 |
39 |
if (__atomic_compare_exchange_n(lock, &expected, mypid, |
|
182
|
39 |
0 |
if (__builtin_expect(spin < BUF_RWLOCK_SPIN_LIMIT, 1)) { |
|
188
|
0 |
0 |
if (cur != 0) { |
|
191
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT) { |
|
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT) { |
|
194
|
0 |
0 |
if (val >= BUF_RWLOCK_WRITER_BIT) { |
|
196
|
0 |
0 |
if (!buf_pid_alive(pid)) |
|
210
|
2 |
549 |
if (__atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0) |
|
220
|
32 |
0 |
if (__builtin_expect((s & 1) == 0, 1)) return s; |
|
221
|
0 |
0 |
if (__builtin_expect(spin < 100000, 1)) { |
|
227
|
0 |
0 |
if (val >= BUF_RWLOCK_WRITER_BIT) { |
|
229
|
0 |
0 |
if (!buf_pid_alive(pid)) { |
|
261
|
36 |
7 |
if (fd >= 0) { |
|
263
|
7 |
0 |
} else if (errno == EEXIST) { |
|
266
|
0 |
43 |
if (fd < 0) { |
|
272
|
0 |
43 |
if (flock(fd, LOCK_EX) < 0) { |
|
279
|
43 |
0 |
if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) { |
|
|
0 |
43 |
if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) { |
|
288
|
0 |
43 |
if (fstat(fd, &st) < 0) { |
|
295
|
7 |
36 |
if (created || st.st_size == 0) { |
|
|
0 |
7 |
if (created || st.st_size == 0) { |
|
296
|
0 |
36 |
if (ftruncate(fd, (off_t)total_size) < 0) { |
|
305
|
0 |
43 |
if (fstat(fd, &st) < 0) { |
|
314
|
0 |
43 |
if (base == MAP_FAILED) { |
|
323
|
7 |
36 |
if (created || hdr->magic == 0) { |
|
|
0 |
7 |
if (created || hdr->magic == 0) { |
|
338
|
1 |
6 |
if (hdr->magic != BUF_MAGIC) { |
|
342
|
0 |
6 |
if (hdr->version != BUF_VERSION) { |
|
347
|
1 |
5 |
if (hdr->variant_id != variant_id) { |
|
352
|
0 |
5 |
if (hdr->elem_size != elem_size) { |
|
357
|
5 |
0 |
if (hdr->elem_size == 0 || |
|
358
|
5 |
0 |
hdr->data_off < sizeof(BufHeader) || |
|
359
|
5 |
0 |
hdr->data_off >= (uint64_t)st.st_size || |
|
360
|
0 |
5 |
hdr->capacity > ((uint64_t)st.st_size - hdr->data_off) / hdr->elem_size) { |
|
370
|
0 |
41 |
if (!h) { |
|
396
|
37 |
0 |
if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) { |
|
|
0 |
37 |
if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) { |
|
401
|
0 |
37 |
if (total_size == 0) total_size = data_off; |
|
405
|
0 |
37 |
if (base == MAP_FAILED) { |
|
421
|
0 |
37 |
if (!h) { |
|
442
|
5 |
0 |
if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) { |
|
|
0 |
5 |
if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) { |
|
447
|
0 |
5 |
if (total_size == 0) total_size = data_off; |
|
450
|
0 |
5 |
if (fd < 0) { |
|
454
|
0 |
5 |
if (ftruncate(fd, (off_t)total_size) < 0) { |
|
462
|
0 |
5 |
if (base == MAP_FAILED) { |
|
479
|
0 |
5 |
if (!h) { |
|
500
|
0 |
2 |
if (fstat(fd, &st) < 0) { |
|
504
|
0 |
2 |
if ((uint64_t)st.st_size < sizeof(BufHeader)) { |
|
511
|
0 |
2 |
if (base == MAP_FAILED) { |
|
517
|
0 |
2 |
if (hdr->magic != BUF_MAGIC) { |
|
521
|
0 |
2 |
if (hdr->version != BUF_VERSION) { |
|
526
|
1 |
1 |
if (hdr->variant_id != variant_id) { |
|
531
|
0 |
1 |
if (hdr->elem_size != elem_size) { |
|
536
|
1 |
0 |
if (hdr->elem_size == 0 || |
|
537
|
1 |
0 |
hdr->data_off < sizeof(BufHeader) || |
|
538
|
1 |
0 |
hdr->data_off >= (uint64_t)st.st_size || |
|
539
|
0 |
1 |
hdr->capacity > ((uint64_t)st.st_size - hdr->data_off) / hdr->elem_size) { |
|
546
|
0 |
1 |
if (!h) { |
|
568
|
1 |
7 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
|
1 |
0 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
570
|
0 |
8 |
if (efd < 0) return -1; |
|
577
|
0 |
2 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
|
0 |
0 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
583
|
1 |
6 |
if (h->efd < 0) return 0; |
|
589
|
1 |
8 |
if (h->efd < 0) return -1; |
|
591
|
3 |
5 |
if (read(h->efd, &val, sizeof(val)) != sizeof(val)) return -1; |
|
596
|
0 |
84 |
if (!h) return; |
|
597
|
9 |
75 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
|
7 |
2 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
598
|
84 |
0 |
if (h->hdr) munmap(h->hdr, h->mmap_size); |
|
599
|
6 |
78 |
if (h->fd >= 0) close(h->fd); |
|
600
|
41 |
43 |
if (h->path) free(h->path); |
|
624
|
0 |
4 |
if (str_len == 0) { |
|
640
|
0 |
8 |
if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; } |
|
644
|
0 |
1 |
if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; } |
|
648
|
0 |
0 |
if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; } |
|
667
|
1 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
1 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
1 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
1 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
7 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
2 |
5 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
669
|
0 |
1 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
1 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
1 |
4 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
676
|
0 |
1 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
1 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
4 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&h->hdr->seq, seq_start)); |
|
683
|
1 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
1 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
7 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
4 |
3 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
|
0 |
0 |
if (nbytes > data_size || byte_off > data_size - nbytes) return 0; |
|
686
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
3 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(h->hdr); buf_seqlock_write_begin(&h->hdr->seq); } |
|
688
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
3 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h->hdr); } |
|
697
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
4 |
1 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
699
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
4 |
1 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
709
|
0 |
20 |
if (idx >= hdr->capacity) return 0; |
|
711
|
1 |
19 |
if (h->wr_locked) { |
|
718
|
0 |
19 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
721
|
234 |
2 |
while (len > 0 && out[len - 1] == '\0') len--; |
|
|
216 |
18 |
while (len > 0 && out[len - 1] == '\0') len--; |
|
729
|
0 |
519 |
if (idx >= hdr->capacity) return 0; |
|
732
|
517 |
2 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
736
|
517 |
2 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
755
|
0 |
9 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
5 |
if (idx >= hdr->capacity) return 0; |
|
765
|
0 |
1012 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
4 |
if (idx >= hdr->capacity) return 0; |
|
778
|
0 |
2 |
if (idx >= hdr->capacity) return 0; |
|
|
3 |
1199 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
10 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
3 |
if (idx >= hdr->capacity) return 0; |
|
786
|
0 |
1 |
if (idx >= hdr->capacity) return 0; |
|
|
3 |
64 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
9 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
3 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
4 |
if (idx >= hdr->capacity) return 0; |
|
802
|
2 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
2 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
804
|
1 |
1 |
if (h->wr_locked) { |
|
811
|
0 |
1 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
820
|
1 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
1 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
823
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
825
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
834
|
1 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
1 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
1 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
1 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
6 |
1 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
1 |
5 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
836
|
0 |
1 |
if (h->wr_locked) { |
|
|
0 |
1 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
1 |
4 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
|
0 |
0 |
if (h->wr_locked) { |
|
843
|
0 |
1 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
1 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
4 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
|
0 |
0 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
851
|
1 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
1 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
1 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
1 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
4 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
1 |
3 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
854
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
2 |
1 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
856
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
2 |
1 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
871
|
2 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
874
|
25 |
2 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
876
|
2 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
885
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
7 |
1 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
|
0 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
886
|
50 |
1 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
10 |
1 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
350 |
8 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
888
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
7 |
1 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
|
0 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
898
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
4510 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= h->hdr->capacity) return 0; |
|
904
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
4 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= h->hdr->capacity) return 0; |
|
910
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
7 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
917
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1119 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
925
|
0 |
0 |
if (idx >= h->hdr->capacity) return expected; |
|
|
0 |
6 |
if (idx >= h->hdr->capacity) return expected; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return expected; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return expected; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return expected; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return expected; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return expected; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return expected; |
|
933
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
4 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
939
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
4 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
945
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
2 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return 0; |
|
952
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
1002 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
1 |
1001 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
1 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
1 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
|
0 |
0 |
if (count > h->hdr->capacity || from > h->hdr->capacity - count) return 0; |
|
954
|
0 |
0 |
for (uint64_t i = 0; i < count; i++) |
|
|
3003 |
1001 |
for (uint64_t i = 0; i < count; i++) |
|
|
2 |
1 |
for (uint64_t i = 0; i < count; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < count; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < count; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < count; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < count; i++) |
|
|
0 |
0 |
for (uint64_t i = 0; i < count; i++) |
|
982
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
1 |
3 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |
|
|
0 |
0 |
if (idx >= h->hdr->capacity) return NULL; |