diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-09-21 17:57:21 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-09-21 17:57:21 +0000 |
| commit | 5aa29e88e998dc6cb66cd04dd6d8be5d187a0673 (patch) | |
| tree | 38d401d34cb07e3be15ca9544ba2e2a75c5c414b /src/include/c.h | |
| parent | 11b274f00f6c84eb36f787331172b15b2bd47ab1 (diff) | |
| download | postgresql-5aa29e88e998dc6cb66cd04dd6d8be5d187a0673.tar.gz | |
Arrange to align shared disk buffers on at least 32-byte boundaries,
not just MAXALIGN boundaries. This makes a noticeable difference in
the speed of transfers to and from kernel space, at least on recent
Pentiums, and might help other CPUs too. We should look at making
this happen for local buffers and buffile.c too. Patch from Manfred Spraul.
Diffstat (limited to 'src/include/c.h')
| -rw-r--r-- | src/include/c.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/c.h b/src/include/c.h index 02d47bfe46..934e976803 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: c.h,v 1.152 2003/08/04 02:40:10 momjian Exp $ + * $Id: c.h,v 1.153 2003/09/21 17:57:21 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -522,13 +522,16 @@ typedef NameData *Name; * ---------------- */ -#define TYPEALIGN(ALIGNVAL,LEN) (((long)(LEN) + (ALIGNVAL-1)) & ~(ALIGNVAL-1)) +#define TYPEALIGN(ALIGNVAL,LEN) \ + (((long) (LEN) + (ALIGNVAL-1)) & ~((long) (ALIGNVAL-1))) #define SHORTALIGN(LEN) TYPEALIGN(ALIGNOF_SHORT, (LEN)) #define INTALIGN(LEN) TYPEALIGN(ALIGNOF_INT, (LEN)) #define LONGALIGN(LEN) TYPEALIGN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN(LEN) TYPEALIGN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN)) +/* MAXALIGN covers only built-in types, not buffers */ +#define BUFFERALIGN(LEN) TYPEALIGN(ALIGNOF_BUFFER, (LEN)) /* ---------------------------------------------------------------- |
