Re: Splitting up guc.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Splitting up guc.c
Дата
Msg-id 597492.1662837820@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Splitting up guc.c  (Andres Freund <andres@anarazel.de>)
Ответы Re: Splitting up guc.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2022-09-10 15:04:59 -0400, Tom Lane wrote:
>> $ size guc*o
>> text     data     bss     dec     hex filename
>> 13653       4     112   13769    35c9 guc-file.o
>> 54953       0     564   55517    d8dd guc.o
>> 6951        0     112    7063    1b97 guc_hooks.o
>> 43570   62998     216  106784   1a120 guc_tables.o

> A tad surprised by the text size of guc_tables.o - not that it is a problem,
> just seems a bit odd.

There's a pretty fair number of constant tables that got moved to there.
Not to mention all the constant strings.

>> Before proceeding further, I wanted to ask for comments on a design
>> choice that might be controversial.  Even though I don't want to
>> invent guc_hooks.c, I think we *should* invent guc_hooks.h, and
>> consolidate all the GUC hook function declarations there.  The
>> point would be to not have to #include guc.h in headers of unrelated
>> modules.  This is similar to what we've done with utils/fmgrprotos.h,
>> though the motivation is different.  I already moved a few declarations
>> from guc.h to there (and in consequence had to adjust #includes in
>> the modules defining those hooks), but there's a lot more to be done
>> if we apply that policy across the board.  Does anybody think that's
>> a bad approach, or have a better one?

> Hm, I'm not opposed, the reasoning makes sense to me. How would this interact
> with the declaration of the variables underlying GUCs?

I'd still declare the variables as we do now, ie just straightforwardly
export them from the associated modules.  Since they're all of native
C types, they don't cause any inclusion-footprint issues.  We could move
their declarations to a common file I guess, but I don't see any benefit.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Splitting up guc.c
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Splitting up guc.c