Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 537422E003A for ; Mon, 12 May 2008 09:22:54 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 46000-01 for ; Mon, 12 May 2008 09:22:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gmp-eb-inf-2.sun.com (gmp-eb-inf-2.sun.com [192.18.6.24]) by developer.postgresql.org (Postfix) with ESMTP id 9690E2E0031 for ; Mon, 12 May 2008 09:22:41 -0300 (ADT) Received: from fe-emea-10.sun.com (gmp-eb-lb-2-fe1.eu.sun.com [192.18.6.10]) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m4CCMcS8012973 for ; Mon, 12 May 2008 12:22:39 GMT Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K0R00G018PRK100@fe-emea-10.sun.com> (original mail from Zdenek.Kotala@Sun.COM) for pgsql-hackers@postgresql.org; Mon, 12 May 2008 13:22:38 +0100 (BST) Received: from [129.157.18.76] by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K0R00LVC91Q9U00@fe-emea-10.sun.com>; Mon, 12 May 2008 13:22:38 +0100 (BST) Date: Mon, 12 May 2008 14:22:11 +0200 From: Zdenek Kotala Subject: Re: bloated heapam.h In-reply-to: <20080512002853.GD5746@alvh.no-ip.org> To: Alvaro Herrera Cc: Tom Lane , Pg Hackers Message-id: <48283673.2080304@sun.com> MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_uiYOAIHJEVykO/L6Rto/bQ)" References: <20080509185610.GJ5748@alvh.no-ip.org> <48258C7C.9030103@sun.com> <20080510192615.GA9094@alvh.no-ip.org> <6911.1210453845@sss.pgh.pa.us> <20080511044745.GC9136@alvh.no-ip.org> <21641.1210531438@sss.pgh.pa.us> <20080512000642.GB5746@alvh.no-ip.org> <20080512002153.GC5746@alvh.no-ip.org> <20080512002853.GD5746@alvh.no-ip.org> User-Agent: Thunderbird 2.0.0.12 (X11/20080325) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/342 X-Sequence-Number: 118341 This is a multi-part message in MIME format. --Boundary_(ID_uiYOAIHJEVykO/L6Rto/bQ) Content-type: text/plain; format=flowed; charset=us-ascii Content-transfer-encoding: 7BIT 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 --Boundary_(ID_uiYOAIHJEVykO/L6Rto/bQ) Content-type: application/x-shellscript; name=test.sh Content-transfer-encoding: BASE64 Content-disposition: inline; filename=test.sh IyEvYmluL2tzaAoKZm9yIEZJTEUgaW4gYGZpbmQgLiAtbmFtZSAiKi5oImA7IGRv CgllY2hvICJQcm9jZXNzaW5nICR7RklMRX0iCgkKICAgICAgICBlY2hvICIjaW5j bHVkZSBcInBvc3RncmVzLmhcIiIgPiAgX190ZW1wLmgKCWNhdCAiJHtGSUxFfSIg Pj4gX190ZW1wLmgKCWVjaG8gIiNpbmNsdWRlIFwiZGVmaW5lLmhcIiIgPiBfX3Rl bXAyLmgKCWNjIC1FIC1JIC4gX190ZW1wLmggID4+IF9fdGVtcDIuaAoJY2MgLUUg LUkgLiBfX3RlbXAyLmggfCBncmVwIE5PVF9FWFBBTkQKZG9uZQoK --Boundary_(ID_uiYOAIHJEVykO/L6Rto/bQ)--