pgsql: Don't #include utils/palloc.h in common/fe_memutils.h.
От | Tom Lane |
---|---|
Тема | pgsql: Don't #include utils/palloc.h in common/fe_memutils.h. |
Дата | |
Msg-id | E1We77V-0008Vc-7m@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
Don't #include utils/palloc.h in common/fe_memutils.h. This breaks the principle that common/ ought not depend on anything in the server, not only code-wise but in the headers. The only arguable advantage is avoidance of duplication of half a dozen extern declarations, and even that is rather dubious, considering that the previous coding was wrong about which declarations to duplicate: it exposed pnstrdup() to frontend code even though no such function is provided in fe_memutils.c. On the same principle, don't #include utils/memutils.h in the frontend build of psprintf.c. This requires duplicating the definition of MaxAllocSize, but that seems fine to me: there's no a-priori reason why frontend code should use the same size limit as the backend anyway. In passing, clean up some rather odd layout and ordering choices that were imposed on palloc.h to reduce the number of #ifdefs required by the previous approach. Per gripe from Christoph Berg. There's still more work to do to make include/common/ clean, but this part seems reasonably noncontroversial. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/e4c1a496f2320f65c27c7a08288c434d8b12876a Modified Files -------------- src/include/common/fe_memutils.h | 8 +++++++- src/include/utils/palloc.h | 16 +++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-)
В списке pgsql-committers по дате отправления: