Re: page macros cleanup - Mailing list pgsql-patches

From Pavan Deolasee
Subject Re: page macros cleanup
Date
Msg-id 2e78013d0807040350m3b2913cfkceaa70d8f9d697c2@mail.gmail.com
Whole thread Raw
In response to Re: page macros cleanup  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: page macros cleanup
List pgsql-patches
On Fri, Jul 4, 2008 at 3:37 PM, Heikki Linnakangas
<heikki@enterprisedb.com> wrote:
>
>
> I think this is the way it should be:
>
> #define HashMaxItemSize \
>        (BLCKSZ - \
>         SizeOfPageHeaderData - \
>         MAXALIGN(sizeof(HashPageOpaqueData)) - \
>         sizeof(ItemIdData))
>

I am wondering if this would fail for corner case if HashMaxItemSize
happened to be unaligned. For example, if (itemsz < HashMaxItemSize <
MAXALIGN(itemsz), PageAddItem() would later fail with a not-so-obvious
error. Should we just MAXALIGN_DOWN the HashMaxItemSize ?

Thanks,
Pavan


--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com

pgsql-patches by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: page macros cleanup
Next
From: Zdenek Kotala
Date:
Subject: Re: page macros cleanup