bloated heapam.h
От | Alvaro Herrera |
---|---|
Тема | bloated heapam.h |
Дата | |
Msg-id | 20080509185610.GJ5748@alvh.no-ip.org обсуждение исходный текст |
Ответы |
Re: bloated heapam.h
|
Список | pgsql-hackers |
Hi, I noticed heapam.h is included in way too many places. This is bad IMHO because heapam.h itself includes a lot of other headers. A lot of these are easy to fix; the source files just need to include some other headers. Standard cleanup, I don't think anybody would object to that. For example, Index: src/backend/access/gin/ginvacuum.c =================================================================== RCS file: /home/alvherre/Code/cvs/pgsql/src/backend/access/gin/ginvacuum.c,v retrieving revision 1.19 diff -c -p -r1.19 ginvacuum.c *** src/backend/access/gin/ginvacuum.c 1 Jan 2008 19:45:46 -0000 1.19 --- src/backend/access/gin/ginvacuum.c 9 May 2008 18:44:31 -0000 *************** *** 15,24 **** #include "postgres.h" #include "access/genam.h" #include "access/gin.h" - #include "access/heapam.h" #include "miscadmin.h" #include "storage/freespace.h" ! #include "storage/freespace.h" #include "commands/vacuum.h" typedef struct --- 15,23 ---- #include "postgres.h" #include "access/genam.h" #include "access/gin.h" #include "miscadmin.h" #include "storage/freespace.h" ! #include "storage/lmgr.h" #include "commands/vacuum.h" typedef struct Others are more conflictive. For example syncscan.c is keeping the prototypes for its own functions on heapam.h. Also pruneheap.c and rewriteheap.c. As a result, not only themselves need to include heapam.h (without any other need for it), but they force some other files into including heapam.h to get their prototypes. I think this is a mistake; I propose splitting those prototypes to their own files, and #including those as appropriate. Objections? -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
В списке pgsql-hackers по дате отправления: