diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/storage/buffer/buf_init.c | 25 | ||||
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 4 |
2 files changed, 4 insertions, 25 deletions
diff --git a/src/backend/storage/buffer/buf_init.c b/src/backend/storage/buffer/buf_init.c index 52e6ae02223..5051e762d85 100644 --- a/src/backend/storage/buffer/buf_init.c +++ b/src/backend/storage/buffer/buf_init.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.74 2005/08/08 03:11:44 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.75 2005/08/12 05:05:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,11 +19,9 @@ BufferDesc *BufferDescriptors; -Block *BufferBlockPointers; +char *BufferBlocks; int32 *PrivateRefCount; -static char *BufferBlocks; - /* statistics counters */ long int ReadBufferCount; long int ReadLocalBufferCount; @@ -154,30 +152,11 @@ InitBufferPool(void) void InitBufferPoolAccess(void) { - char *block; - int i; - /* * Allocate and zero local arrays of per-buffer info. */ - BufferBlockPointers = (Block *) calloc(NBuffers, - sizeof(*BufferBlockPointers)); PrivateRefCount = (int32 *) calloc(NBuffers, sizeof(*PrivateRefCount)); - - /* - * Construct addresses for the individual buffer data blocks. We do - * this just to speed up the BufferGetBlock() macro. (Since the - * addresses should be the same in every backend, we could inherit - * this data from the postmaster --- but in the EXEC_BACKEND case - * that doesn't work.) - */ - block = BufferBlocks; - for (i = 0; i < NBuffers; i++) - { - BufferBlockPointers[i] = (Block) block; - block += BLCKSZ; - } } /* diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index f148a5ea005..6243f2481e4 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.192 2005/08/08 19:44:22 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.193 2005/08/12 05:05:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ /* Note: these two macros only work on shared buffers, not local ones! */ -#define BufHdrGetBlock(bufHdr) BufferBlockPointers[(bufHdr)->buf_id] +#define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ)) #define BufferGetLSN(bufHdr) (*((XLogRecPtr*) BufHdrGetBlock(bufHdr))) /* Note: this macro only works on local buffers, not shared ones! */ |