Branch Coverage

buf_generic.h
Criterion Covered Total %
branch 355 1032 34.4


line true false branch
126 0 17 if (pid == 0) return 1;
127 13 4 return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
0 13 return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
144 0 557 if (!h->reader_slots) return;
147 0 557 if (h->cached_fork_gen != cur_gen) {
151 529 28 if (h->my_slot_idx != UINT32_MAX) return;
155 29 0 for (uint32_t i = 0; i < BUF_READER_SLOTS; i++) {
158 28 1 if (__atomic_compare_exchange_n(&h->reader_slots[s].pid,
174 0 2 if (!sub) return;
177 0 2 uint32_t want = (cur > sub) ? cur - sub : 0;
178 2 0 if (__atomic_compare_exchange_n(p, &cur, want,
191 0 5 if (!__atomic_compare_exchange_n(&h->reader_slots[i].pid, &expected, 0,
197 1 4 if (wp) { buf_atomic_sub_cap(&hdr->rwlock_waiters, wp); drained = 1; }
198 1 4 if (writp) { buf_atomic_sub_cap(&hdr->rwlock_writers_waiting, writp); drained = 1; }
205 0 2 if (!h->reader_slots) return;
215 2048 2 for (uint32_t i = 0; i < BUF_READER_SLOTS; i++) {
217 2041 7 if (pid == 0) continue;
219 2 5 if (buf_pid_alive(pid)) {
220 1 1 if (sc > 0) any_live_reader = 1;
223 4 1 if (sc > 0) { found_dead_reader = 1; continue; }
224 1 0 if (buf_drain_dead_slot(h, i, pid)) any_recovery = 1;
230 1 1 if (found_dead_reader && !any_live_reader) {
1 0 if (found_dead_reader && !any_live_reader) {
234 1 0 if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) {
1 0 if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) {
237 1025 0 for (uint32_t i = 0; !live_now && i < BUF_READER_SLOTS; i++) {
1024 1 for (uint32_t i = 0; !live_now && i < BUF_READER_SLOTS; i++) {
239 5 1019 if (p && buf_pid_alive(p) &&
1 4 if (p && buf_pid_alive(p) &&
240 0 1 __atomic_load_n(&h->reader_slots[i].subcount, __ATOMIC_RELAXED) > 0)
243 0 1 if (live_now) {
245 1 0 } else if (__atomic_compare_exchange_n(&hdr->rwlock, &cur, 0,
248 0 1 if (__atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0)
254 1 0 if (drain_ok) {
255 1024 1 for (uint32_t i = 0; i < BUF_READER_SLOTS; i++) {
257 5 1019 if (p == 0 || buf_pid_alive(p)) continue;
1 4 if (p == 0 || buf_pid_alive(p)) continue;
258 0 4 if (buf_drain_dead_slot(h, i, p)) any_recovery = 1;
262 2 0 if (any_recovery)
270 1 0 if (h->my_slot_idx != UINT32_MAX)
275 1 0 if (h->my_slot_idx != UINT32_MAX)
281 1 0 if (h->my_slot_idx != UINT32_MAX) {
289 1 0 if (h->my_slot_idx != UINT32_MAX) {
297 0 0 if (!__atomic_compare_exchange_n(&hdr->rwlock, &observed_rwlock,
301 0 0 if (seq & 1)
305 0 0 if (__atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0)
322 0 2 if (val >= BUF_RWLOCK_WRITER_BIT) {
324 0 0 if (!buf_pid_alive(pid))
338 2 0 if (h->my_slot_idx != UINT32_MAX)
342 0 35 if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) {
0 0 if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) {
343 0 0 if (__atomic_compare_exchange_n(lock, &cur, cur + 1,
346 35 0 } else if (cur == 0 && !__atomic_load_n(writers_waiting, __ATOMIC_RELAXED)) {
2 33 } else if (cur == 0 && !__atomic_load_n(writers_waiting, __ATOMIC_RELAXED)) {
347 2 0 if (__atomic_compare_exchange_n(lock, &cur, 1,
351 32 1 if (__builtin_expect(spin < BUF_RWLOCK_SPIN_LIMIT, 1)) {
357 1 0 if (cur >= BUF_RWLOCK_WRITER_BIT || cur == 0) {
1 0 if (cur >= BUF_RWLOCK_WRITER_BIT || cur == 0) {
360 1 0 if (rc == -1 && errno == ETIMEDOUT) {
1 0 if (rc == -1 && errno == ETIMEDOUT) {
377 2 0 if (h->my_slot_idx != UINT32_MAX)
379 2 0 if (prev == 0 && __atomic_load_n(&h->hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0)
0 2 if (prev == 0 && __atomic_load_n(&h->hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0)
390 555 262 if (__atomic_compare_exchange_n(lock, &expected, mypid,
393 261 1 if (__builtin_expect(spin < BUF_RWLOCK_SPIN_LIMIT, 1)) {
399 1 0 if (cur != 0) {
402 1 0 if (rc == -1 && errno == ETIMEDOUT) {
1 0 if (rc == -1 && errno == ETIMEDOUT) {
416 1 554 if (__atomic_load_n(&h->hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0)
426 34 0 if (__builtin_expect((s & 1) == 0, 1)) return s;
427 0 0 if (__builtin_expect(spin < 100000, 1)) {
433 0 0 if (val >= BUF_RWLOCK_WRITER_BIT) {
435 0 0 if (!buf_pid_alive(pid)) {
472 46 0 for (int attempt = 0; attempt < 100; attempt++) {
474 39 7 if (fd >= 0) { (void)fchmod(fd, file_mode); *created = 1; return fd; } /* exact mode: umask narrowed the create */
475 0 7 if (errno != EEXIST) {
480 7 0 if (fd >= 0) { *created = 0; return fd; }
481 0 0 if (errno == ENOENT) continue; /* creator unlinked between our two opens; retry */
495 0 46 if (fd < 0) {
500 0 46 if (flock(fd, LOCK_EX) < 0) {
509 46 0 if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) {
0 46 if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) {
518 0 46 if (fstat(fd, &st) < 0) {
525 7 39 if (!created && st.st_size > 0 && (uint64_t)st.st_size < sizeof(BufHeader)) {
7 0 if (!created && st.st_size > 0 && (uint64_t)st.st_size < sizeof(BufHeader)) {
0 7 if (!created && st.st_size > 0 && (uint64_t)st.st_size < sizeof(BufHeader)) {
529 7 39 if (created || st.st_size == 0) {
0 7 if (created || st.st_size == 0) {
530 0 39 if (ftruncate(fd, (off_t)total_size) < 0) {
539 0 46 if (fstat(fd, &st) < 0) {
548 0 46 if (base == MAP_FAILED) {
557 7 39 if (created || hdr->magic == 0) {
0 7 if (created || hdr->magic == 0) {
561 0 39 if (!created && (uint64_t)st.st_size < total_size) {
0 0 if (!created && (uint64_t)st.st_size < total_size) {
581 1 6 if (hdr->magic != BUF_MAGIC) {
585 0 6 if (hdr->version != BUF_VERSION) {
590 1 5 if (hdr->variant_id != variant_id) {
595 0 5 if (hdr->elem_size != elem_size) {
600 5 0 if (hdr->elem_size == 0 ||
601 5 0 hdr->reader_slots_off < sizeof(BufHeader) ||
602 5 0 hdr->reader_slots_off > (uint64_t)st.st_size ||
603 5 0 hdr->reader_slots_off + reader_slots_size > (uint64_t)st.st_size ||
604 5 0 hdr->data_off < hdr->reader_slots_off + reader_slots_size ||
605 5 0 hdr->data_off > (uint64_t)st.st_size ||
606 0 5 hdr->capacity > ((uint64_t)st.st_size - hdr->data_off) / hdr->elem_size) {
616 0 44 if (!h) {
646 40 0 if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) {
0 40 if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) {
654 0 40 if (base == MAP_FAILED) {
672 0 40 if (!h) {
697 9 0 if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) {
0 9 if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) {
704 0 9 if (fd < 0) {
708 0 9 if (ftruncate(fd, (off_t)total_size) < 0) {
717 0 9 if (base == MAP_FAILED) {
735 0 9 if (!h) {
758 0 5 if (fstat(fd, &st) < 0) {
762 0 5 if ((uint64_t)st.st_size < sizeof(BufHeader)) {
769 0 5 if (base == MAP_FAILED) {
775 0 5 if (hdr->magic != BUF_MAGIC) {
779 0 5 if (hdr->version != BUF_VERSION) {
784 1 4 if (hdr->variant_id != variant_id) {
789 0 4 if (hdr->elem_size != elem_size) {
795 4 0 if (hdr->elem_size == 0 ||
796 4 0 hdr->reader_slots_off < sizeof(BufHeader) ||
797 4 0 hdr->reader_slots_off > (uint64_t)st.st_size ||
798 4 0 hdr->reader_slots_off + reader_slots_size > (uint64_t)st.st_size ||
799 4 0 hdr->data_off < hdr->reader_slots_off + reader_slots_size ||
800 4 0 hdr->data_off > (uint64_t)st.st_size ||
801 4 0 hdr->total_size != (uint64_t)st.st_size ||
802 0 4 hdr->capacity > ((uint64_t)st.st_size - hdr->data_off) / hdr->elem_size) {
809 0 4 if (myfd < 0) {
816 0 4 if (!h) {
841 3 0 if (!h || !h->hdr) return 0;
0 3 if (!h || !h->hdr) return 0;
848 1 7 if (h->efd >= 0) return h->efd;
850 0 7 if (efd < 0) return -1;
857 0 2 if (h->efd >= 0 && h->efd_owned) close(h->efd);
0 0 if (h->efd >= 0 && h->efd_owned) close(h->efd);
863 1 6 if (h->efd < 0) return 0;
869 1 8 if (h->efd < 0) return -1;
871 2 6 if (read(h->efd, &val, sizeof(val)) != sizeof(val)) return -1;
876 0 97 if (!h) return;
880 97 0 if (h->reader_slots && h->my_slot_idx != UINT32_MAX && h->cached_pid &&
28 69 if (h->reader_slots && h->my_slot_idx != UINT32_MAX && h->cached_pid &&
28 0 if (h->reader_slots && h->my_slot_idx != UINT32_MAX && h->cached_pid &&
881 27 1 h->cached_fork_gen == __atomic_load_n(&buf_fork_gen, __ATOMIC_RELAXED) &&
882 27 0 __atomic_load_n(&h->reader_slots[h->my_slot_idx].subcount, __ATOMIC_ACQUIRE) == 0) {
892 9 88 if (h->efd >= 0 && h->efd_owned) close(h->efd);
7 2 if (h->efd >= 0 && h->efd_owned) close(h->efd);
893 97 0 if (h->hdr) munmap(h->hdr, h->mmap_size);
894 13 84 if (h->fd >= 0) close(h->fd);
895 44 53 if (h->path) free(h->path);
919 0 4 if (str_len == 0) {
935 0 8 if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; }
939 0 2 if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; }
943 0 1 if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; }
962 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;
964 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) {
971 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));
978 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;
981 1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
3 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&h->hdr->seq); }
983 1 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
3 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&h->hdr->seq); buf_rwlock_wrunlock(h); }
992 1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
4 1 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
994 1 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
4 1 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1004 0 22 if (idx >= hdr->capacity) return 0;
1006 1 21 if (h->wr_locked) {
1013 0 21 } while (buf_seqlock_read_retry(&hdr->seq, seq_start));
1016 258 2 while (len > 0 && out[len - 1] == '\0') len--;
238 20 while (len > 0 && out[len - 1] == '\0') len--;
1024 0 521 if (idx >= hdr->capacity) return 0;
1027 519 2 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1031 519 2 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1050 0 9 if (idx >= hdr->capacity) return 0;
0 5 if (idx >= hdr->capacity) return 0;
1060 0 1012 if (idx >= hdr->capacity) return 0;
0 4 if (idx >= hdr->capacity) return 0;
1073 0 2 if (idx >= hdr->capacity) return 0;
3 1104 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;
1081 0 1 if (idx >= hdr->capacity) return 0;
3 67 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;
1097 2 0 if (count > hdr->capacity || from > hdr->capacity - count) return 0;
0 2 if (count > hdr->capacity || from > hdr->capacity - count) return 0;
1099 1 1 if (h->wr_locked) {
1106 0 1 } while (buf_seqlock_read_retry(&hdr->seq, seq_start));
1115 1 0 if (count > hdr->capacity || from > hdr->capacity - count) return 0;
0 1 if (count > hdr->capacity || from > hdr->capacity - count) return 0;
1118 1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1120 1 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1129 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;
1131 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) {
1138 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));
1146 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;
1149 1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
2 1 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1151 1 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
2 1 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1166 2 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1169 25 2 for (uint64_t i = 0; i < hdr->capacity; i++)
1171 2 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1180 1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
8 1 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
0 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1181 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++)
366 9 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++)
1183 1 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
8 1 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
0 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1193 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;
1199 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;
1205 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;
1212 0 1 if (idx >= h->hdr->capacity) return 0;
0 1021 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;
1220 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;
1228 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;
1234 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;
1240 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;
1247 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;
1249 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++)
1277 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;