summaryrefslogtreecommitdiff
path: root/src/include/access/hash.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-07-13 20:45:47 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-07-13 20:45:47 +0000
commit9d035f425452279041c52e01cf83b2a27e121b5c (patch)
treed521a3bdb9ca231ed49e09a48259a45b519f6d1c /src/include/access/hash.h
parent45efb09a01e93d20ccb5671703649d9f87f744de (diff)
Clean up the use of some page-header-access macros: principally, use
SizeOfPageHeaderData instead of sizeof(PageHeaderData) in places where that makes the code clearer, and avoid casting between Page and PageHeader where possible. Zdenek Kotala, with some additional cleanup by Heikki Linnakangas. I did not apply the parts of the proposed patch that would have resulted in slightly changing the on-disk format of hash indexes; it seems to me that's not a win as long as there's any chance of having in-place upgrade for 8.4.
Diffstat (limited to 'src/include/access/hash.h')
-rw-r--r--src/include/access/hash.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/include/access/hash.h b/src/include/access/hash.h
index 4d8cd79e9a8..0dab2b6ae91 100644
--- a/src/include/access/hash.h
+++ b/src/include/access/hash.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/hash.h,v 1.88 2008/06/19 00:46:05 alvherre Exp $
+ * $PostgreSQL: pgsql/src/include/access/hash.h,v 1.89 2008/07/13 20:45:47 tgl Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
@@ -166,10 +166,10 @@ typedef HashMetaPageData *HashMetaPage;
* Maximum size of a hash index item (it's okay to have only one per page)
*/
#define HashMaxItemSize(page) \
- (PageGetPageSize(page) - \
- sizeof(PageHeaderData) - \
- MAXALIGN(sizeof(HashPageOpaqueData)) - \
- sizeof(ItemIdData))
+ MAXALIGN_DOWN(PageGetPageSize(page) - \
+ SizeOfPageHeaderData - \
+ sizeof(ItemIdData) - \
+ MAXALIGN(sizeof(HashPageOpaqueData)))
#define HASH_MIN_FILLFACTOR 10
#define HASH_DEFAULT_FILLFACTOR 75