This is the mail archive of the
mailing list for the glibc project.
Re: BENCHTESTS: memmove benchtests do not test overlapping memory regions
- From: Stefan Liebler <stli at linux dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 12 Feb 2019 09:11:29 +0100
- Subject: Re: BENCHTESTS: memmove benchtests do not test overlapping memory regions
- References: <5C5DA585.email@example.com>
On 02/08/2019 04:51 PM, Anton Youdkevitch wrote:
The current testing framework is using two buffers
for all sorts of string benchmarks. Considering how
the buffers get allocated (using mmap with the first
argument set to 0) they can never overlap.
So, the memmove benchtest actually tests memcpy
(with a little additional startup) instead of memmove.
I would like to adapt memmove benchset to cover the
case of overlapping memory regions as well.
Just as hint:
s1 = (char *) (buf1 + align1);
s2 = (char *) (buf2 + align2);
do_one_test (..., dst=s2, src=((char *) (buf2 + align1)),
Both src and dst are within buf2 and thus can overlap.