Re: const correctness
От | Tom Lane |
---|---|
Тема | Re: const correctness |
Дата | |
Msg-id | 20583.1320874683@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: const correctness ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>) |
Ответы |
Re: const correctness
Re: const correctness |
Список | pgsql-hackers |
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes: > 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. I don't doubt that just duplicating macros and inlineable functions is a wash performance-wise (in fact, in principle it shouldn't change the generated code at all). My objection is the one Robert already noted: it takes extra brain cells to remember which function/macro to use, and I have seen not a shred of evidence that that extra development/maintenance effort will be repaid. I think that "const" works materially better in C++ where you can overload foo(struct *) and foo(const struct *) and let the compiler sort out which is being called. In C, the impedance match is a lot worse, so you have to pick and choose where const is worth the trouble. regards, tom lane
В списке pgsql-hackers по дате отправления: