Re: bloated heapam.h

Поиск
Список
Период
Сортировка
От Zdenek Kotala
Тема Re: bloated heapam.h
Дата
Msg-id 48283673.2080304@sun.com
обсуждение исходный текст
Ответ на Re: bloated heapam.h  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: bloated heapam.h  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera wrote:
> Alvaro Herrera wrote:
>
>> Oops :-(  I just noticed that I removed bufmgr.h from bufpage.h, which
>> is a change you had objected to previously :-(
>
> However, it seems the right fix is to move BufferGetPageSize and
> BufferGetPage from bufpage.h to bufmgr.h.

+1 It makes more sense.

> (Digging further, it seems like bufpage.h should also include transam.h
> in order to get TransactionIdIsNormal ... I start to wonder how many
> problems of this nature we have on our headers.  Without having a way to
> detect whether the defined macros are valid, it seems hard to check
> programatically, however.)
>

I attached script which should check it. In first step it runs C preprocessor on
each header (postgres.h is included as well). The output from first step is
processed again with preprocessor and define.h is included. Define.h contains
"all" used macros in following format:

#define SIGABRT "NOT_EXPANDED_SIGABRT"

Main problem is how to generate define.h. I used following magic:

grep "^#define" `find . -name "*.h"` | cut -d" "  -f 2 | cut -f 1 | cut -f 1 -d"("

but it generates some noise as well. Maybe some Perl or AWK magic should be better.

        Zdenek

Вложения

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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: XIDs and big boxes again ...
Следующее
От: Suresh
Дата:
Сообщение: Stack depth exceeded error