Re: Violation of principle that plan trees are read-only
От | Jose Luis Tallon |
---|---|
Тема | Re: Violation of principle that plan trees are read-only |
Дата | |
Msg-id | 74303baf-d2de-a39e-3bd7-1546d06d8de6@adv-solutions.net обсуждение исходный текст |
Ответ на | Re: Violation of principle that plan trees are read-only (Nico Williams <nico@cryptonector.com>) |
Список | pgsql-hackers |
On 20/5/25 22:43, Nico Williams wrote: > [snip] > What you want is for C to have a type attribute that denotes > immutability all the way down. `const` doesn't do that. One thing that > could be done is to write a utility that creates const-all-the-way-down > clones of given types, but such a tool can't be written as C > pre-processor macros -- it would have to be a tool that parses the > actual type definitions, or uses DWARF or similar to from the > compilation of a file (I've done this latter before, but this weds you > to compilers that output DWARF, which MSVC doesn't, for example). > > Really, the C committee ought to add this at some point, darn it. It > would be the opposite of Rust's &mut. Like C++'s const specifier, specially const references to objects? This is actually natively compatible with C code, "just" by throwing extern "C" around..... https://en.cppreference.com/w/cpp/language/cv (most of Postgres' code is already "Object-oriented in C" in my view...) The fact that the C++ compiler is usually able to optimize deeper/better than a C one due to aggresive inlining+global optimization and inferred "strict"ness doesn't hurt either :) My €.02. HTH. / J.L. -- Parkinson's Law: Work expands to fill the time alloted to it.
В списке pgsql-hackers по дате отправления: