1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Make LocalRefCount and PrivateRefCount arrays of int32, rather than long.

This saves a small amount of per-backend memory for LP64 machines.
This commit is contained in:
Neil Conway
2004-04-22 07:21:55 +00:00
parent 2ff4e44043
commit 139abc2896
4 changed files with 46 additions and 36 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.64 2004/04/21 18:06:30 tgl Exp $
* $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.65 2004/04/22 07:21:55 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@ -21,7 +21,7 @@
BufferDesc *BufferDescriptors;
Block *BufferBlockPointers;
long *PrivateRefCount; /* also used in freelist.c */
int32 *PrivateRefCount; /* also used in freelist.c */
bits8 *BufferLocks; /* flag bits showing locks I have set */
/* statistics counters */
@ -176,9 +176,11 @@ InitBufferPoolAccess(void)
/*
* Allocate and zero local arrays of per-buffer info.
*/
BufferBlockPointers = (Block *) calloc(NBuffers, sizeof(Block));
PrivateRefCount = (long *) calloc(NBuffers, sizeof(long));
BufferLocks = (bits8 *) calloc(NBuffers, sizeof(bits8));
BufferBlockPointers = (Block *) calloc(NBuffers,
sizeof(*BufferBlockPointers));
PrivateRefCount = (int32 *) calloc(NBuffers,
sizeof(*PrivateRefCount));
BufferLocks = (bits8 *) calloc(NBuffers, sizeof(*BufferLocks));
/*
* Convert shmem offsets into addresses as seen by this process. This