@ -74,7 +74,7 @@ typedef struct BufferAccessStrategyData
/* Overall strategy type */
BufferAccessStrategyType btype ;
/* Number of elements in buffers[] array */
int ring_ size ;
int nbuffe rs;
/*
* Index of the " current " slot in the ring , ie , the one most recently
@ -541,7 +541,7 @@ BufferAccessStrategy
GetAccessStrategy ( BufferAccessStrategyType btype )
{
BufferAccessStrategy strategy ;
int ring_ size ;
int nbuffe rs;
/*
* Select ring size to use . See buffer / README for rationales .
@ -556,13 +556,13 @@ GetAccessStrategy(BufferAccessStrategyType btype)
return NULL ;
case BAS_BULKREAD :
ring_ size = 256 * 1024 / BLCKSZ ;
nbuffe rs = 256 * 1024 / BLCKSZ ;
break ;
case BAS_BULKWRITE :
ring_ size = 16 * 1024 * 1024 / BLCKSZ ;
nbuffe rs = 16 * 1024 * 1024 / BLCKSZ ;
break ;
case BAS_VACUUM :
ring_ size = 256 * 1024 / BLCKSZ ;
nbuffe rs = 256 * 1024 / BLCKSZ ;
break ;
default :
@ -572,16 +572,16 @@ GetAccessStrategy(BufferAccessStrategyType btype)
}
/* Make sure ring isn't an undue fraction of shared buffers */
ring_ size = Min ( NBuffers / 8 , ring_ size ) ;
nbuffe rs = Min ( NBuffers / 8 , nbuffe rs) ;
/* Allocate the object and initialize all elements to zeroes */
strategy = ( BufferAccessStrategy )
palloc0 ( offsetof ( BufferAccessStrategyData , buffers ) +
ring_ size * sizeof ( Buffer ) ) ;
nbuffe rs * sizeof ( Buffer ) ) ;
/* Set fields that don't start out zero */
strategy - > btype = btype ;
strategy - > ring_ size = ring_ size ;
strategy - > nbuffe rs = nbuffe rs;
return strategy ;
}
@ -615,7 +615,7 @@ GetBufferFromRing(BufferAccessStrategy strategy, uint32 *buf_state)
/* Advance to next ring slot */
if ( + + strategy - > current > = strategy - > ring_ size )
if ( + + strategy - > current > = strategy - > nbuffe rs)
strategy - > current = 0 ;
/*