Lines Matching refs:nbytes

25   const size_t nbytes = state.range(0);  in BM_string_memcmp()  local
31 char* src_aligned = GetAlignedPtrFilled(&src, src_alignment, nbytes, 'x'); in BM_string_memcmp()
32 char* dst_aligned = GetAlignedPtrFilled(&dst, dst_alignment, nbytes, 'x'); in BM_string_memcmp()
36 c += memcmp(dst_aligned, src_aligned, nbytes); in BM_string_memcmp()
39 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_memcmp()
44 const size_t nbytes = state.range(0); in BM_string_memcpy() local
50 char* src_aligned = GetAlignedPtrFilled(&src, src_alignment, nbytes, 'x'); in BM_string_memcpy()
51 char* dst_aligned = GetAlignedPtr(&dst, dst_alignment, nbytes); in BM_string_memcpy()
54 memcpy(dst_aligned, src_aligned, nbytes); in BM_string_memcpy()
57 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_memcpy()
62 const size_t nbytes = state.range(0); in BM_string_memmove_non_overlapping() local
68 char* src_aligned = GetAlignedPtrFilled(&src, src_alignment, nbytes, 'x'); in BM_string_memmove_non_overlapping()
69 char* dst_aligned = GetAlignedPtrFilled(&dst, dst_alignment, nbytes, 'y'); in BM_string_memmove_non_overlapping()
72 memmove(dst_aligned, src_aligned, nbytes); in BM_string_memmove_non_overlapping()
75 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_memmove_non_overlapping()
80 const size_t nbytes = state.range(0); in BM_string_memmove_overlap_dst_before_src() local
83 std::vector<char> buf(3 * alignment + nbytes + 1, 'x'); in BM_string_memmove_overlap_dst_before_src()
84 char* buf_aligned = GetAlignedPtrFilled(&buf, alignment, nbytes + 1, 'x'); in BM_string_memmove_overlap_dst_before_src()
87 memmove(buf_aligned, buf_aligned + 1, nbytes); // Worst-case overlap. in BM_string_memmove_overlap_dst_before_src()
90 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_memmove_overlap_dst_before_src()
95 const size_t nbytes = state.range(0); in BM_string_memmove_overlap_src_before_dst() local
99 char* buf_aligned = GetAlignedPtrFilled(&buf, alignment, nbytes + 1, 'x'); in BM_string_memmove_overlap_src_before_dst()
102 memmove(buf_aligned + 1, buf_aligned, nbytes); // Worst-case overlap. in BM_string_memmove_overlap_src_before_dst()
105 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_memmove_overlap_src_before_dst()
110 const size_t nbytes = state.range(0); in BM_string_memset() local
114 char* buf_aligned = GetAlignedPtr(&buf, alignment, nbytes + 1); in BM_string_memset()
117 memset(buf_aligned, 0, nbytes); in BM_string_memset()
120 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_memset()
125 const size_t nbytes = state.range(0); in BM_string_strlen() local
129 char* buf_aligned = GetAlignedPtrFilled(&buf, alignment, nbytes + 1, 'x'); in BM_string_strlen()
130 buf_aligned[nbytes - 1] = '\0'; in BM_string_strlen()
137 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strlen()
142 const size_t nbytes = state.range(0); in BM_string_strcat_copy_only() local
148 char* src_aligned = GetAlignedPtrFilled(&src, src_alignment, nbytes, 'x'); in BM_string_strcat_copy_only()
149 char* dst_aligned = GetAlignedPtr(&dst, dst_alignment, nbytes + 2); in BM_string_strcat_copy_only()
150 src_aligned[nbytes - 1] = '\0'; in BM_string_strcat_copy_only()
160 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strcat_copy_only()
165 const size_t nbytes = state.range(0); in BM_string_strcat_seek_only() local
172 char* dst_aligned = GetAlignedPtrFilled(&dst, dst_alignment, nbytes + 2, 'y'); in BM_string_strcat_seek_only()
174 dst_aligned[nbytes - 1] = '\0'; in BM_string_strcat_seek_only()
178 dst_aligned[nbytes - 1] = '\0'; in BM_string_strcat_seek_only()
181 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strcat_seek_only()
186 const size_t nbytes = state.range(0); in BM_string_strcat_half_copy_half_seek() local
191 if ((nbytes / 2) == 0) { in BM_string_strcat_half_copy_half_seek()
197 char* src_aligned = GetAlignedPtrFilled(&src, src_alignment, nbytes / 2, 'x'); in BM_string_strcat_half_copy_half_seek()
198 char* dst_aligned = GetAlignedPtrFilled(&dst, dst_alignment, nbytes, 'y'); in BM_string_strcat_half_copy_half_seek()
199 src_aligned[nbytes / 2 - 1] = '\0'; in BM_string_strcat_half_copy_half_seek()
200 dst_aligned[nbytes / 2 - 1] = '\0'; in BM_string_strcat_half_copy_half_seek()
204 dst_aligned[nbytes / 2 - 1] = '\0'; in BM_string_strcat_half_copy_half_seek()
207 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strcat_half_copy_half_seek()
212 const size_t nbytes = state.range(0); in BM_string_strcpy() local
218 char* src_aligned = GetAlignedPtrFilled(&src, src_alignment, nbytes, 'x'); in BM_string_strcpy()
219 char* dst_aligned = GetAlignedPtr(&dst, dst_alignment, nbytes); in BM_string_strcpy()
220 src_aligned[nbytes - 1] = '\0'; in BM_string_strcpy()
226 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strcpy()
231 const size_t nbytes = state.range(0); in BM_string_strcmp() local
237 char* s1_aligned = GetAlignedPtrFilled(&s1, s1_alignment, nbytes, 'x'); in BM_string_strcmp()
238 char* s2_aligned = GetAlignedPtrFilled(&s2, s2_alignment, nbytes, 'x'); in BM_string_strcmp()
239 s1_aligned[nbytes - 1] = '\0'; in BM_string_strcmp()
240 s2_aligned[nbytes - 1] = '\0'; in BM_string_strcmp()
247 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strcmp()
252 const size_t nbytes = state.range(0); in BM_string_strncmp() local
258 char* s1_aligned = GetAlignedPtrFilled(&s1, s1_alignment, nbytes, 'x'); in BM_string_strncmp()
259 char* s2_aligned = GetAlignedPtrFilled(&s2, s2_alignment, nbytes, 'x'); in BM_string_strncmp()
263 c = strncmp(s1_aligned, s2_aligned, nbytes); in BM_string_strncmp()
266 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strncmp()
271 const size_t nbytes = state.range(0); in BM_string_strstr() local
277 char* haystack_aligned = GetAlignedPtrFilled(&haystack, haystack_alignment, nbytes, 'x'); in BM_string_strstr()
279 std::min(nbytes, static_cast<size_t>(5)), 'x'); in BM_string_strstr()
281 if (nbytes / 4 > 2) { in BM_string_strstr()
282 for (size_t i = 0; nbytes / 4 >= 2 && i < nbytes / 4 - 2; i++) { in BM_string_strstr()
286 haystack_aligned[nbytes - 1] = '\0'; in BM_string_strstr()
295 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strstr()
300 const size_t nbytes = state.range(0); in BM_string_strchr() local
304 char* haystack_aligned = GetAlignedPtrFilled(&haystack, haystack_alignment, nbytes, 'x'); in BM_string_strchr()
305 haystack_aligned[nbytes-1] = '\0'; in BM_string_strchr()
313 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_strchr()