Lines Matching refs:idx
80 size_t avail, idx, l; in ring_buf_write_at() local
94 idx = logical_offset % r->alloc; in ring_buf_write_at()
95 l = r->alloc - idx; in ring_buf_write_at()
99 memcpy(start + idx, buf, l); in ring_buf_write_at()
117 size_t pushed = 0, avail, idx, l; in ring_buf_push() local
131 idx = r->head_offset % r->alloc; in ring_buf_push()
132 l = r->alloc - idx; in ring_buf_push()
136 memcpy(start + idx, buf, l); in ring_buf_push()
151 size_t idx; in ring_buf_get_ptr() local
155 idx = logical_offset % r->alloc; in ring_buf_get_ptr()
156 *max_len = r->alloc - idx; in ring_buf_get_ptr()
157 return start + idx; in ring_buf_get_ptr()
178 size_t idx, l; in ring_buf_get_buf_at() local
189 idx = logical_offset % r->alloc; in ring_buf_get_buf_at()
191 if (l > r->alloc - idx) in ring_buf_get_buf_at()
192 l = r->alloc - idx; in ring_buf_get_buf_at()
194 *buf = start + idx; in ring_buf_get_buf_at()
209 size_t idx = r->ctail_offset % r->alloc; in ring_buf_cpop_range() local
216 if (l > r->alloc - idx) { in ring_buf_cpop_range()
217 OPENSSL_cleanse((unsigned char *)r->start + idx, r->alloc - idx); in ring_buf_cpop_range()
218 l -= r->alloc - idx; in ring_buf_cpop_range()
219 idx = 0; in ring_buf_cpop_range()
222 OPENSSL_cleanse((unsigned char *)r->start + idx, l); in ring_buf_cpop_range()