diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-12 05:05:51 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-12 05:05:51 +0000 |
| commit | 3ae7e4a33b595c4f157d29e4584175a054b5b520 (patch) | |
| tree | a7d5a0c868902d31d5728f75e3078a4e63d028f3 /src/include/storage/bufmgr.h | |
| parent | b609695b7a5c1cf7c1234143eeb35809d00ff741 (diff) | |
Remove BufferBlockPointers array in favor of a base + (bufnum) * BLCKSZ
computation. On modern machines this is as fast if not faster, and we
don't have to clog the CPU's L2 cache with a tens-of-KB pointer array.
If we ever decide to adopt a more dynamic allocation method for shared
buffers, we'll probably have to revert this patch, but in the meantime
we might as well save a few bytes and nanoseconds. Per Qingqing Zhou.
Diffstat (limited to 'src/include/storage/bufmgr.h')
| -rw-r--r-- | src/include/storage/bufmgr.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index eb7268edfc7..a88565e1596 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.94 2005/08/08 03:12:16 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.95 2005/08/12 05:05:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -33,7 +33,7 @@ extern int bgwriter_lru_maxpages; extern int bgwriter_all_maxpages; /* in buf_init.c */ -extern DLLIMPORT Block *BufferBlockPointers; +extern DLLIMPORT char *BufferBlocks; extern DLLIMPORT int32 *PrivateRefCount; /* in localbuf.c */ @@ -107,7 +107,7 @@ extern DLLIMPORT int32 *LocalRefCount; BufferIsLocal(buffer) ? \ LocalBufferBlockPointers[-(buffer) - 1] \ : \ - BufferBlockPointers[(buffer) - 1] \ + (Block) (BufferBlocks + ((Size) ((buffer) - 1)) * BLCKSZ) \ ) /* |
