Avoid useless loop overhead in AtEOXact routines when the backend is
compiled with USE_ASSERT_CHECKING but is running with assert_enabled false.
This commit is contained in:
parent
4568e0f791
commit
15269b5955
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.191 2005/08/08 03:11:44 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.192 2005/08/08 19:44:22 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1067,15 +1067,18 @@ void
|
|||||||
AtEOXact_Buffers(bool isCommit)
|
AtEOXact_Buffers(bool isCommit)
|
||||||
{
|
{
|
||||||
#ifdef USE_ASSERT_CHECKING
|
#ifdef USE_ASSERT_CHECKING
|
||||||
|
if (assert_enabled)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < NBuffers; i++)
|
for (i = 0; i < NBuffers; i++)
|
||||||
{
|
{
|
||||||
Assert(PrivateRefCount[i] == 0);
|
Assert(PrivateRefCount[i] == 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
AtEOXact_LocalBuffers(isCommit);
|
AtEOXact_LocalBuffers(isCommit);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Make sure we reset the strategy hint in case VACUUM errored out */
|
/* Make sure we reset the strategy hint in case VACUUM errored out */
|
||||||
StrategyHintVacuum(false);
|
StrategyHintVacuum(false);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.67 2005/05/29 04:23:04 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.68 2005/08/08 19:44:22 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -308,12 +308,15 @@ void
|
|||||||
AtEOXact_LocalBuffers(bool isCommit)
|
AtEOXact_LocalBuffers(bool isCommit)
|
||||||
{
|
{
|
||||||
#ifdef USE_ASSERT_CHECKING
|
#ifdef USE_ASSERT_CHECKING
|
||||||
|
if (assert_enabled)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < NLocBuffer; i++)
|
for (i = 0; i < NLocBuffer; i++)
|
||||||
{
|
{
|
||||||
Assert(LocalRefCount[i] == 0);
|
Assert(LocalRefCount[i] == 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user