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

From Greg Stark
Subject Re: overlapping strncpy/memcpy errors via valgrind
Date
Msg-id CAM-w4HN2dN5iGwm-RajgmpzBb9F51HjnLBN_Qoht5ZH9PoLqpg@mail.gmail.com
Whole thread Raw
In response to Re: overlapping strncpy/memcpy errors via valgrind  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Feb 17, 2013 at 4:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.

In terms of runtime I strongly suspect the effect would be 0 due to
branch prediction.

The effect on the code cleanliness seems like a stronger argument but
I have a hard time getting upset about a single one-line if statement
in namestrcpy. I suspect the argument may have been that we have no
reason to believe namestrcpy is the only place this can happen.

-- 
greg



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: [RFC] indirect toast tuple support
Next
From: "David E. Wheeler"
Date:
Subject: Re: JSON Function Bike Shedding