Re: const correctness - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: const correctness
Date
Msg-id 4EBA9B670200002500042C38@gw.wicourts.gov
Whole thread Raw
In response to Re: const correctness  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: const correctness
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> wrote:
> So what happens when someone wants to use list_nth in one of the
> outfuncs?  Would we then rip all these back out?
If we just go this far and don't create a separate const flavor of
the one function and two macros, then we would at least need to rip
out the const keyword on the parameter of the affected function(s).
> Or would we then bite the bullet and duplicate the code?
I'm not sure we shouldn't go that far right up front.  The entire
body of the only duplicated function is:   return l ? l->head : NULL;
As cloned code goes, I've seen worse.
Of the two new macros, one has three lines of body, the other has
one line.
If people aren't inclined to support this on the grounds of API
clarity, maybe we should do some sort of benchmark run while we have
a patch which applies cleanly before writing off the possible
performance impact, but I'm not sure what makes a good stress-test
for the affected code.
-Kevin


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: const correctness
Next
From: Daniel Farina
Date:
Subject: Re: 9.1.2 ?