Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > bloated heapam....
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 22 Topic 9336 of 9808
Post > Topic >>

bloated heapam.h

by alvherre@[EMAIL PROTECTED] (Alvaro Herrera) May 9, 2008 at 02:56 PM

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.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
 




 22 Posts in Topic:
bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-09 14:56:10 
Re: bloated heapam.h
Zdenek.Kotala@[EMAIL PROT  2008-05-10 13:52:28 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-10 15:26:16 
Re: bloated heapam.h
tgl@[EMAIL PROTECTED] (T  2008-05-10 17:10:45 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-11 00:30:23 
Re: bloated heapam.h
tgl@[EMAIL PROTECTED] (T  2008-05-11 00:49:59 
Re: bloated heapam.h
tgl@[EMAIL PROTECTED] (T  2008-05-11 14:43:58 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-11 20:06:42 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-11 20:21:53 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-11 20:28:53 
Re: bloated heapam.h
tgl@[EMAIL PROTECTED] (T  2008-05-11 20:35:16 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-11 21:04:39 
Re: bloated heapam.h
tgl@[EMAIL PROTECTED] (T  2008-05-11 20:30:59 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-12 12:10:22 
Re: bloated heapam.h
Zdenek.Kotala@[EMAIL PROT  2008-05-15 17:48:58 
Re: bloated heapam.h
Zdenek.Kotala@[EMAIL PROT  2008-05-12 21:52:27 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-12 16:02:53 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-13 11:42:00 
Re: bloated heapam.h
Zdenek.Kotala@[EMAIL PROT  2008-05-12 14:22:11 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-12 12:13:50 
Re: bloated heapam.h
Zdenek.Kotala@[EMAIL PROT  2008-05-12 21:08:05 
Re: bloated heapam.h
alvherre@[EMAIL PROTECTED  2008-05-12 15:26:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 7:07:12 CDT 2008.