Branch Coverage

buf_generic.h
Criterion Covered Total %
branch 338 1000 33.8


line true false branch
126 0 12 if (pid == 0) return 1;
127 9 3 return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
0 9 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) {
232 1 0 if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) {
1 0 if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) {
233 1 0 if (__atomic_compare_exchange_n(&hdr->rwlock, &cur, 0,
236 0 1 if (__atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0)
240 1024 1 for (uint32_t i = 0; i < BUF_READER_SLOTS; i++) {
242 1019 5 if (pid == 0) continue;
243 1 4 if (buf_pid_alive(pid)) continue;
244 0 4 if (buf_drain_dead_slot(h, i, pid)) any_recovery = 1;
247 2 0 if (any_recovery)
255 1 0 if (h->my_slot_idx != UINT32_MAX)
260 1 0 if (h->my_slot_idx != UINT32_MAX)
266 1 0 if (h->my_slot_idx != UINT32_MAX) {
274 1 0 if (h->my_slot_idx != UINT32_MAX) {
282 0 0 if (!__atomic_compare_exchange_n(&hdr->rwlock, &observed_rwlock,
286 0 0 if (seq & 1)
290 0 0 if (__atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0)
307 0 2 if (val >= BUF_RWLOCK_WRITER_BIT) {
309 0 0 if (!buf_pid_alive(pid))
323 2 0 if (h->my_slot_idx != UINT32_MAX)
327 0 35 if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) {
0 0 if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) {
328 0 0 if (__atomic_compare_exchange_n(lock, &cur, cur + 1,
331 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)) {
332 2 0 if (__atomic_compare_exchange_n(lock, &cur, 1,
336 32 1 if (__builtin_expect(spin < BUF_RWLOCK_SPIN_LIMIT, 1)) {
342 1 0 if (cur >= BUF_RWLOCK_WRITER_BIT || cur == 0) {
1 0 if (cur >= BUF_RWLOCK_WRITER_BIT || cur == 0) {
345 1 0 if (rc == -1 && errno == ETIMEDOUT) {
1 0 if (rc == -1 && errno == ETIMEDOUT) {
362 2 0 if (h->my_slot_idx != UINT32_MAX)
364 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)
375 555 139 if (__atomic_compare_exchange_n(lock, &expected, mypid,
378 138 1 if (__builtin_expect(spin < BUF_RWLOCK_SPIN_LIMIT, 1)) {
384 1 0 if (cur != 0) {
387 1 0 if (rc == -1 && errno == ETIMEDOUT) {
1 0 if (rc == -1 && errno == ETIMEDOUT) {
401 11 544 if (__atomic_load_n(&h->hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0)
411 34 0 if (__builtin_expect((s & 1) == 0, 1)) return s;
412 0 0 if (__builtin_expect(spin < 100000, 1)) {
418 0 0 if (val >= BUF_RWLOCK_WRITER_BIT) {
420 0 0 if (!buf_pid_alive(pid)) {
452 39 7 if (fd >= 0) {
454 7 0 } else if (errno == EEXIST) {
457 0 46 if (fd < 0) {
463 0 46 if (flock(fd, LOCK_EX) < 0) {
472 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) {
481 0 46 if (fstat(fd, &st) < 0) {
488 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)) {
492 7 39 if (created || st.st_size == 0) {
0 7 if (created || st.st_size == 0) {
493 0 39 if (ftruncate(fd, (off_t)total_size) < 0) {
502 0 46 if (fstat(fd, &st) < 0) {
511 0 46 if (base == MAP_FAILED) {
520 7 39 if (created || hdr->magic == 0) {
0 7 if (created || hdr->magic == 0) {
537 1 6 if (hdr->magic != BUF_MAGIC) {
541 0 6 if (hdr->version != BUF_VERSION) {
546 1 5 if (hdr->variant_id != variant_id) {
551 0 5 if (hdr->elem_size != elem_size) {
556 5 0 if (hdr->elem_size == 0 ||
557 5 0 hdr->reader_slots_off < sizeof(BufHeader) ||
558 5 0 hdr->reader_slots_off + reader_slots_size > (uint64_t)st.st_size ||
559 5 0 hdr->data_off < hdr->reader_slots_off + reader_slots_size ||
560 5 0 hdr->data_off >= (uint64_t)st.st_size ||
561 0 5 hdr->capacity > ((uint64_t)st.st_size - hdr->data_off) / hdr->elem_size) {
571 0 44 if (!h) {
601 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) {
609 0 40 if (base == MAP_FAILED) {
627 0 40 if (!h) {
652 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) {
659 0 9 if (fd < 0) {
663 0 9 if (ftruncate(fd, (off_t)total_size) < 0) {
672 0 9 if (base == MAP_FAILED) {
690 0 9 if (!h) {
713 0 5 if (fstat(fd, &st) < 0) {
717 0 5 if ((uint64_t)st.st_size < sizeof(BufHeader)) {
724 0 5 if (base == MAP_FAILED) {
730 0 5 if (hdr->magic != BUF_MAGIC) {
734 0 5 if (hdr->version != BUF_VERSION) {
739 1 4 if (hdr->variant_id != variant_id) {
744 0 4 if (hdr->elem_size != elem_size) {
750 4 0 if (hdr->elem_size == 0 ||
751 4 0 hdr->reader_slots_off < sizeof(BufHeader) ||
752 4 0 hdr->reader_slots_off + reader_slots_size > (uint64_t)st.st_size ||
753 4 0 hdr->data_off < hdr->reader_slots_off + reader_slots_size ||
754 4 0 hdr->total_size != (uint64_t)st.st_size ||
755 0 4 hdr->capacity > ((uint64_t)st.st_size - hdr->data_off) / hdr->elem_size) {
762 0 4 if (myfd < 0) {
769 0 4 if (!h) {
794 3 0 if (!h || !h->hdr) return 0;
0 3 if (!h || !h->hdr) return 0;
801 1 7 if (h->efd >= 0) return h->efd;
803 0 7 if (efd < 0) return -1;
810 0 2 if (h->efd >= 0 && h->efd_owned) close(h->efd);
0 0 if (h->efd >= 0 && h->efd_owned) close(h->efd);
816 1 6 if (h->efd < 0) return 0;
822 1 8 if (h->efd < 0) return -1;
824 2 6 if (read(h->efd, &val, sizeof(val)) != sizeof(val)) return -1;
829 0 97 if (!h) return;
833 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 &&
834 27 1 h->cached_fork_gen == __atomic_load_n(&buf_fork_gen, __ATOMIC_RELAXED)) {
843 9 88 if (h->efd >= 0 && h->efd_owned) close(h->efd);
7 2 if (h->efd >= 0 && h->efd_owned) close(h->efd);
844 97 0 if (h->hdr) munmap(h->hdr, h->mmap_size);
845 13 84 if (h->fd >= 0) close(h->fd);
846 44 53 if (h->path) free(h->path);
870 0 4 if (str_len == 0) {
886 0 8 if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; }
890 0 2 if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; }
894 0 1 if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; }
913 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;
915 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) {
922 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));
929 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;
932 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); }
934 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); }
943 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); }
945 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); }
955 0 22 if (idx >= hdr->capacity) return 0;
957 1 21 if (h->wr_locked) {
964 0 21 } while (buf_seqlock_read_retry(&hdr->seq, seq_start));
967 258 2 while (len > 0 && out[len - 1] == '\0') len--;
238 20 while (len > 0 && out[len - 1] == '\0') len--;
975 0 521 if (idx >= hdr->capacity) return 0;
978 519 2 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
982 519 2 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1001 0 9 if (idx >= hdr->capacity) return 0;
0 5 if (idx >= hdr->capacity) return 0;
1011 0 1012 if (idx >= hdr->capacity) return 0;
0 4 if (idx >= hdr->capacity) return 0;
1024 0 2 if (idx >= hdr->capacity) return 0;
3 1201 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;
1032 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;
1048 2 0 if (count > hdr->capacity || from > hdr->capacity - count) return 0;
0 2 if (count > hdr->capacity || from > hdr->capacity - count) return 0;
1050 1 1 if (h->wr_locked) {
1057 0 1 } while (buf_seqlock_read_retry(&hdr->seq, seq_start));
1066 1 0 if (count > hdr->capacity || from > hdr->capacity - count) return 0;
0 1 if (count > hdr->capacity || from > hdr->capacity - count) return 0;
1069 1 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1071 1 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1080 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;
1082 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) {
1089 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));
1097 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;
1100 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); }
1102 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); }
1117 2 0 if (!nested) { buf_rwlock_wrlock(h); buf_seqlock_write_begin(&hdr->seq); }
1120 25 2 for (uint64_t i = 0; i < hdr->capacity; i++)
1122 2 0 if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(h); }
1131 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); }
1132 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++)
1134 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); }
1144 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;
1150 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;
1156 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;
1163 0 1 if (idx >= h->hdr->capacity) return 0;
0 1118 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;
1171 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;
1179 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;
1185 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;
1191 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;
1198 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;
1200 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++)
1228 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;