mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Remove BufferLocks[] array in favor of a single pointer to the buffer
(if any) currently waited for by LockBufferForCleanup(), which is all that we were using it for anymore. Saves some space and eliminates proportional-to-NBuffers slowdown in UnlockBuffers().
This commit is contained in:
		@@ -8,7 +8,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * IDENTIFICATION
 | 
			
		||||
 *	  $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.68 2004/08/29 05:06:47 momjian Exp $
 | 
			
		||||
 *	  $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.69 2004/10/16 18:05:06 tgl Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -20,9 +20,7 @@
 | 
			
		||||
 | 
			
		||||
BufferDesc *BufferDescriptors;
 | 
			
		||||
Block	   *BufferBlockPointers;
 | 
			
		||||
 | 
			
		||||
int32	   *PrivateRefCount;	/* also used in freelist.c */
 | 
			
		||||
bits8	   *BufferLocks;		/* flag bits showing locks I have set */
 | 
			
		||||
int32	   *PrivateRefCount;
 | 
			
		||||
 | 
			
		||||
/* statistics counters */
 | 
			
		||||
long int	ReadBufferCount;
 | 
			
		||||
@@ -177,7 +175,6 @@ InitBufferPoolAccess(void)
 | 
			
		||||
										   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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user