| line |
true |
false |
branch |
|
109
|
0 |
0 |
if (pid == 0) return 1; |
|
110
|
0 |
0 |
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH); |
|
|
0 |
0 |
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH); |
|
115
|
0 |
0 |
if (!__atomic_compare_exchange_n(&hdr->rwlock, &observed_rwlock, |
|
119
|
0 |
0 |
if (seq & 1) |
|
123
|
0 |
0 |
if (__atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0) |
|
135
|
0 |
1 |
if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) { |
|
|
0 |
0 |
if (cur > 0 && cur < BUF_RWLOCK_WRITER_BIT) { |
|
136
|
0 |
0 |
if (__atomic_compare_exchange_n(lock, &cur, cur + 1, |
|
139
|
1 |
0 |
} else if (cur == 0 && !__atomic_load_n(writers_waiting, __ATOMIC_RELAXED)) { |
|
|
1 |
0 |
} else if (cur == 0 && !__atomic_load_n(writers_waiting, __ATOMIC_RELAXED)) { |
|
140
|
1 |
0 |
if (__atomic_compare_exchange_n(lock, &cur, 1, |
|
144
|
0 |
0 |
if (__builtin_expect(spin < BUF_RWLOCK_SPIN_LIMIT, 1)) { |
|
150
|
0 |
0 |
if (cur >= BUF_RWLOCK_WRITER_BIT || cur == 0) { |
|
|
0 |
0 |
if (cur >= BUF_RWLOCK_WRITER_BIT || cur == 0) { |
|
153
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT) { |
|
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT) { |
|
155
|
0 |
0 |
if (cur >= BUF_RWLOCK_WRITER_BIT) { |
|
157
|
0 |
0 |
if (val >= BUF_RWLOCK_WRITER_BIT) { |
|
159
|
0 |
0 |
if (!buf_pid_alive(pid)) |
|
166
|
0 |
0 |
while (wc > 0 && !__atomic_compare_exchange_n( |
|
167
|
0 |
0 |
writers_waiting, &wc, wc - 1, |
|
181
|
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) |
|
192
|
553 |
196 |
if (__atomic_compare_exchange_n(lock, &expected, mypid, |
|
195
|
196 |
0 |
if (__builtin_expect(spin < BUF_RWLOCK_SPIN_LIMIT, 1)) { |
|
202
|
0 |
0 |
if (cur != 0) { |
|
205
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT) { |
|
|
0 |
0 |
if (rc == -1 && errno == ETIMEDOUT) { |
|
209
|
0 |
0 |
if (val >= BUF_RWLOCK_WRITER_BIT) { |
|
211
|
0 |
0 |
if (!buf_pid_alive(pid)) |
|
226
|
0 |
553 |
if (__atomic_load_n(&hdr->rwlock_waiters, __ATOMIC_RELAXED) > 0) |
|
236
|
34 |
0 |
if (__builtin_expect((s & 1) == 0, 1)) return s; |
|
237
|
0 |
0 |
if (__builtin_expect(spin < 100000, 1)) { |
|
243
|
0 |
0 |
if (val >= BUF_RWLOCK_WRITER_BIT) { |
|
245
|
0 |
0 |
if (!buf_pid_alive(pid)) { |
|
277
|
37 |
7 |
if (fd >= 0) { |
|
279
|
7 |
0 |
} else if (errno == EEXIST) { |
|
282
|
0 |
44 |
if (fd < 0) { |
|
288
|
0 |
44 |
if (flock(fd, LOCK_EX) < 0) { |
|
295
|
44 |
0 |
if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) { |
|
|
0 |
44 |
if (elem_size > 0 && capacity > (UINT64_MAX - data_off) / elem_size) { |
|
304
|
0 |
44 |
if (fstat(fd, &st) < 0) { |
|
311
|
7 |
37 |
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)) { |
|
315
|
7 |
37 |
if (created || st.st_size == 0) { |
|
|
0 |
7 |
if (created || st.st_size == 0) { |
|
316
|
0 |
37 |
if (ftruncate(fd, (off_t)total_size) < 0) { |
|
325
|
0 |
44 |
if (fstat(fd, &st) < 0) { |
|
334
|
0 |
44 |
if (base == MAP_FAILED) { |
|
343
|
7 |
37 |
if (created || hdr->magic == 0) { |
|
|
0 |
7 |
if (created || hdr->magic == 0) { |
|
358
|
1 |
6 |
if (hdr->magic != BUF_MAGIC) { |
|
362
|
0 |
6 |
if (hdr->version != BUF_VERSION) { |
|
367
|
1 |
5 |
if (hdr->variant_id != variant_id) { |
|
372
|
0 |
5 |
if (hdr->elem_size != elem_size) { |
|
377
|
5 |
0 |
if (hdr->elem_size == 0 || |
|
378
|
5 |
0 |
hdr->data_off < sizeof(BufHeader) || |
|
379
|
5 |
0 |
hdr->data_off >= (uint64_t)st.st_size || |
|
380
|
0 |
5 |
hdr->capacity > ((uint64_t)st.st_size - hdr->data_off) / hdr->elem_size) { |
|
390
|
0 |
42 |
if (!h) { |
|
416
|
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) { |
|
424
|
0 |
40 |
if (base == MAP_FAILED) { |
|
440
|
0 |
40 |
if (!h) { |
|
461
|
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) { |
|
468
|
0 |
9 |
if (fd < 0) { |
|
472
|
0 |
9 |
if (ftruncate(fd, (off_t)total_size) < 0) { |
|
481
|
0 |
9 |
if (base == MAP_FAILED) { |
|
498
|
0 |
9 |
if (!h) { |
|
519
|
0 |
5 |
if (fstat(fd, &st) < 0) { |
|
523
|
0 |
5 |
if ((uint64_t)st.st_size < sizeof(BufHeader)) { |
|
530
|
0 |
5 |
if (base == MAP_FAILED) { |
|
536
|
0 |
5 |
if (hdr->magic != BUF_MAGIC) { |
|
540
|
0 |
5 |
if (hdr->version != BUF_VERSION) { |
|
545
|
1 |
4 |
if (hdr->variant_id != variant_id) { |
|
550
|
0 |
4 |
if (hdr->elem_size != elem_size) { |
|
555
|
4 |
0 |
if (hdr->elem_size == 0 || |
|
556
|
4 |
0 |
hdr->data_off != sizeof(BufHeader) || |
|
557
|
4 |
0 |
hdr->total_size != (uint64_t)st.st_size || |
|
558
|
0 |
4 |
hdr->capacity > ((uint64_t)st.st_size - hdr->data_off) / hdr->elem_size) { |
|
565
|
0 |
4 |
if (myfd < 0) { |
|
572
|
0 |
4 |
if (!h) { |
|
595
|
3 |
0 |
if (!h || !h->hdr) return 0; |
|
|
0 |
3 |
if (!h || !h->hdr) return 0; |
|
602
|
1 |
7 |
if (h->efd >= 0) return h->efd; |
|
604
|
0 |
7 |
if (efd < 0) return -1; |
|
611
|
0 |
2 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
|
0 |
0 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
617
|
1 |
6 |
if (h->efd < 0) return 0; |
|
623
|
1 |
8 |
if (h->efd < 0) return -1; |
|
625
|
2 |
6 |
if (read(h->efd, &val, sizeof(val)) != sizeof(val)) return -1; |
|
630
|
0 |
95 |
if (!h) return; |
|
631
|
9 |
86 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
|
7 |
2 |
if (h->efd >= 0 && h->efd_owned) close(h->efd); |
|
632
|
95 |
0 |
if (h->hdr) munmap(h->hdr, h->mmap_size); |
|
633
|
13 |
82 |
if (h->fd >= 0) close(h->fd); |
|
634
|
42 |
53 |
if (h->path) free(h->path); |
|
658
|
0 |
4 |
if (str_len == 0) { |
|
674
|
0 |
8 |
if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; } |
|
678
|
0 |
2 |
if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; } |
|
682
|
0 |
1 |
if (str_len == 0) { snprintf(errbuf, BUF_ERR_BUFLEN, "str_len must be > 0"); return NULL; } |
|
701
|
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; |
|
703
|
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) { |
|
710
|
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)); |
|
717
|
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; |
|
720
|
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); } |
|
722
|
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); } |
|
731
|
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); } |
|
733
|
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); } |
|
743
|
0 |
22 |
if (idx >= hdr->capacity) return 0; |
|
745
|
1 |
21 |
if (h->wr_locked) { |
|
752
|
0 |
21 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
755
|
258 |
2 |
while (len > 0 && out[len - 1] == '\0') len--; |
|
|
238 |
20 |
while (len > 0 && out[len - 1] == '\0') len--; |
|
763
|
0 |
521 |
if (idx >= hdr->capacity) return 0; |
|
766
|
519 |
2 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
770
|
519 |
2 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
789
|
0 |
9 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
5 |
if (idx >= hdr->capacity) return 0; |
|
799
|
0 |
1012 |
if (idx >= hdr->capacity) return 0; |
|
|
0 |
4 |
if (idx >= hdr->capacity) return 0; |
|
812
|
0 |
2 |
if (idx >= hdr->capacity) return 0; |
|
|
3 |
1250 |
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; |
|
820
|
0 |
1 |
if (idx >= hdr->capacity) return 0; |
|
|
3 |
66 |
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; |
|
836
|
2 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
2 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
838
|
1 |
1 |
if (h->wr_locked) { |
|
845
|
0 |
1 |
} while (buf_seqlock_read_retry(&hdr->seq, seq_start)); |
|
854
|
1 |
0 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
|
0 |
1 |
if (count > hdr->capacity || from > hdr->capacity - count) return 0; |
|
857
|
1 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
859
|
1 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
868
|
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; |
|
870
|
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) { |
|
877
|
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)); |
|
885
|
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; |
|
888
|
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); } |
|
890
|
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); } |
|
905
|
2 |
0 |
if (!nested) { buf_rwlock_wrlock(hdr); buf_seqlock_write_begin(&hdr->seq); } |
|
908
|
25 |
2 |
for (uint64_t i = 0; i < hdr->capacity; i++) |
|
910
|
2 |
0 |
if (!nested) { buf_seqlock_write_end(&hdr->seq); buf_rwlock_wrunlock(hdr); } |
|
919
|
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); } |
|
920
|
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++) |
|
922
|
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); } |
|
932
|
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; |
|
938
|
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; |
|
944
|
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; |
|
951
|
0 |
1 |
if (idx >= h->hdr->capacity) return 0; |
|
|
0 |
1168 |
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; |
|
959
|
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; |
|
967
|
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; |
|
973
|
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; |
|
979
|
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; |
|
986
|
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; |
|
988
|
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++) |
|
1016
|
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; |