Re: const correctness

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: const correctness
Дата
Msg-id 4EBA9B670200002500042C38@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: const correctness  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: const correctness  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: const correctness
Следующее
От: Daniel Farina
Дата:
Сообщение: Re: 9.1.2 ?