diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2018-08-08 00:44:56 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2018-08-08 00:44:56 +0530 |
commit | 014efdd7ea3c6756d215b9fe51bdbb8ee8bd549b (patch) | |
tree | 3db170340e150623d1c237e42072dda3f06aa563 /benchtests/bench-strncmp.c | |
parent | 92a4cba76076ce1aa0efa7b859708e057c2a757f (diff) | |
download | glibc-014efdd7ea3c6756d215b9fe51bdbb8ee8bd549b.zip glibc-014efdd7ea3c6756d215b9fe51bdbb8ee8bd549b.tar.gz glibc-014efdd7ea3c6756d215b9fe51bdbb8ee8bd549b.tar.bz2 |
benchtests: Clean up the alloc_bufs
Drop realloc_bufs in favour of making alloc_bufs transparently
reallocate the buffers if it had allocated before. Also consolidate
computation of buffer lengths so that they don't get repeated on every
reallocation.
* benchtests/bench-string.h (buf1_size, buf2_size): New
variables.
(init_sizes): New function.
(test_init): Use it.
(alloc_buf, exit_error): New functions.
(alloc_bufs): Use ALLOC_BUF.
(realloc_bufs): Remove.
* benchtests/bench-memcmp.c (do_test): Adjust.
* benchtests/bench-memset-large.c (do_test): Likewise.
* benchtests/bench-memset-walk.c (do_test): Likewise.
* benchtests/bench-memset.c (do_test): Likewise.
* benchtests/bench-strncmp.c (do_test): Likewise.
Diffstat (limited to 'benchtests/bench-strncmp.c')
-rw-r--r-- | benchtests/bench-strncmp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/benchtests/bench-strncmp.c b/benchtests/bench-strncmp.c index 97dc390..92cf0d2 100644 --- a/benchtests/bench-strncmp.c +++ b/benchtests/bench-strncmp.c @@ -150,7 +150,7 @@ do_test_limit (json_ctx_t *json_ctx, size_t align1, size_t align2, size_t len, FOR_EACH_IMPL (impl, 0) { - realloc_bufs (); + alloc_bufs (); s1 = (CHAR *) (buf1 + page_size - n * CHARBYTES); s2 = (CHAR *) (buf2 + page_size - n * CHARBYTES); @@ -207,7 +207,7 @@ do_test (json_ctx_t *json_ctx, size_t align1, size_t align2, size_t len, size_t FOR_EACH_IMPL (impl, 0) { - realloc_bufs (); + alloc_bufs (); s1 = (CHAR *) (buf1 + align1); s2 = (CHAR *) (buf2 + align2); |