The second patch adds a more explicative error message to BufferPoolCheckLeak.

It should be completely harmless.

Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
This commit is contained in:
Marc G. Fournier 1997-01-23 19:43:23 +00:00
parent 5184bd7cb3
commit 37a8bdba43
1 changed files with 9 additions and 4 deletions

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.9 1997/01/20 04:36:48 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.10 1997/01/23 19:43:23 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1105,15 +1105,20 @@ int
BufferPoolCheckLeak() BufferPoolCheckLeak()
{ {
register int i; register int i;
int error = 0;
void PrintBufferDescs(); void PrintBufferDescs();
for (i = 1; i <= NBuffers; i++) { for (i = 1; i <= NBuffers; i++) {
if (BufferIsValid(i)) { if (BufferIsValid(i)) {
elog(NOTICE, "buffer leak detected in BufferPoolCheckLeak()"); elog(NOTICE,
"buffer leak [%d] detected in BufferPoolCheckLeak()", i-1);
error = 1;
}
}
if(error) {
PrintBufferDescs(); PrintBufferDescs();
return(1); return(1);
} }
}
return(0); return(0);
} }