Re: overlapping strncpy/memcpy errors via valgrind - Mailing list pgsql-hackers

From Tom Lane
Subject Re: overlapping strncpy/memcpy errors via valgrind
Date
Msg-id 12103.1361118400@sss.pgh.pa.us
Whole thread Raw
In response to Re: overlapping strncpy/memcpy errors via valgrind  (Boszormenyi Zoltan <zb@cybertec.at>)
Responses Re: overlapping strncpy/memcpy errors via valgrind
Re: overlapping strncpy/memcpy errors via valgrind
List pgsql-hackers
Boszormenyi Zoltan <zb@cybertec.at> writes:
> Then, why isn't memcpy() skipped if the source and dest are the same?
> It would be a micro-optimization but a valid one.

No, it'd be more like a micro-pessimization, because the test would be
wasted effort in the vast majority of calls.  The *only* reason to do
this would be to shut up valgrind, and that seems annoying.

I wonder if anyone's tried filing a bug against valgrind to say that it
shouldn't complain about this case.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Boszormenyi Zoltan
Date:
Subject: Re: overlapping strncpy/memcpy errors via valgrind
Next
From: Tom Lane
Date:
Subject: Re: FDW for PostgreSQL