Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4acc97d

Browse files
author
Neil Conway
committed
Assert that BufferIsPinned() in IncrBufferRefCount(), rather than using
a home-brewed combination of assertions that boiled down to the samething.
1 parentdec2c77 commit4acc97d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

‎src/backend/storage/buffer/bufmgr.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.181 2004/10/17 22:01:50 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.182 2004/11/24 02:56:17 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1549,25 +1549,18 @@ ReleaseBuffer(Buffer buffer)
15491549
*at least once.
15501550
*
15511551
*This function cannot be used on a buffer we do not have pinned,
1552-
*because it doesn't change the shared buffer state. Therefore the
1553-
*Assert checks are for refcount > 0. Someone got this wrong once...
1552+
*because it doesn't change the shared buffer state.
15541553
*/
15551554
void
15561555
IncrBufferRefCount(Bufferbuffer)
15571556
{
1558-
Assert(BufferIsValid(buffer));
1557+
Assert(BufferIsPinned(buffer));
15591558
ResourceOwnerEnlargeBuffers(CurrentResourceOwner);
15601559
ResourceOwnerRememberBuffer(CurrentResourceOwner,buffer);
15611560
if (BufferIsLocal(buffer))
1562-
{
1563-
Assert(LocalRefCount[-buffer-1]>0);
15641561
LocalRefCount[-buffer-1]++;
1565-
}
15661562
else
1567-
{
1568-
Assert(PrivateRefCount[buffer-1]>0);
15691563
PrivateRefCount[buffer-1]++;
1570-
}
15711564
}
15721565

15731566
#ifdefNOT_USED

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp