Lines Matching full:nbytes
29 static void BM_string_memcmp(int iters, int nbytes) {
31 char* src = new char[nbytes]; char* dst = new char[nbytes];
32 memset(src, 'x', nbytes);
33 memset(dst, 'x', nbytes);
38 c += memcmp(dst, src, nbytes);
42 SetBenchmarkBytesProcessed(int64_t(iters) * int64_t(nbytes));
48 static void BM_string_memcpy(int iters, int nbytes) {
50 char* src = new char[nbytes]; char* dst = new char[nbytes];
51 memset(src, 'x', nbytes);
55 memcpy(dst, src, nbytes);
59 SetBenchmarkBytesProcessed(int64_t(iters) * int64_t(nbytes));
65 static void BM_string_memmove(int iters, int nbytes) {
67 char* buf = new char[nbytes + 64];
68 memset(buf, 'x', nbytes + 64);
72 memmove(buf, buf + 1, nbytes); // Worst-case overlap.
76 SetBenchmarkBytesProcessed(int64_t(iters) * int64_t(nbytes));
81 static void BM_string_memset(int iters, int nbytes) {
83 char* dst = new char[nbytes];
87 memset(dst, 0, nbytes);
91 SetBenchmarkBytesProcessed(int64_t(iters) * int64_t(nbytes));
96 static void BM_string_strlen(int iters, int nbytes) {
98 char* s = new char[nbytes];
99 memset(s, 'x', nbytes);
100 s[nbytes - 1] = 0;
109 SetBenchmarkBytesProcessed(int64_t(iters) * int64_t(nbytes));