aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/buf_init.c
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2003-12-14 00:34:47 +0000
committerNeil Conway <neilc@samurai.com>2003-12-14 00:34:47 +0000
commitfef0c8345a96f953ebfe59fcc22a9eeb980b25c5 (patch)
tree853c777b605251bd9143a855d21cd12e62c9be06 /src/backend/storage/buffer/buf_init.c
parent81e9455150bcb1ebc5774c7c4fd4d5ed6ba8ac1b (diff)
downloadpostgresql-fef0c8345a96f953ebfe59fcc22a9eeb980b25c5.tar.gz
postgresql-fef0c8345a96f953ebfe59fcc22a9eeb980b25c5.zip
I posted some bufmgr cleanup a few weeks ago, but it conflicted with
some concurrent changes Jan was making to the bufmgr. Here's an updated version of the patch -- it should apply cleanly to CVS HEAD and passes the regression tests. This patch makes the following changes: - remove the UnlockAndReleaseBuffer() and UnlockAndWriteBuffer() macros, and replace uses of them with calls to the appropriate functions. - remove a bunch of #ifdef BMTRACE code: it is ugly & broken (i.e. it doesn't compile) - make BufferReplace() return a bool, not an int - cleanup some logic in bufmgr.c; should be functionality equivalent to the previous code, just cleaner now - remove the BM_PRIVATE flag as it is unused - improve a few comments, etc.
Diffstat (limited to 'src/backend/storage/buffer/buf_init.c')
-rw-r--r--src/backend/storage/buffer/buf_init.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/backend/storage/buffer/buf_init.c b/src/backend/storage/buffer/buf_init.c
index ebb3a7c3e1d..1c66b950a51 100644
--- a/src/backend/storage/buffer/buf_init.c
+++ b/src/backend/storage/buffer/buf_init.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.58 2003/11/29 19:51:56 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.59 2003/12/14 00:34:47 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -34,17 +34,6 @@
#include "utils/hsearch.h"
#include "utils/memutils.h"
-
-/*
- * if BMTRACE is defined, we trace the last 200 buffer allocations and
- * deallocations in a circular buffer in shared memory.
- */
-#ifdef BMTRACE
-bmtrace *TraceBuf;
-long *CurTraceBuf;
-
-#define BMT_LIMIT 200
-#endif /* BMTRACE */
int ShowPinTrace = 0;
int Data_Descriptors;
@@ -138,16 +127,6 @@ InitBufferPool(void)
*/
LWLockAcquire(BufMgrLock, LW_EXCLUSIVE);
-#ifdef BMTRACE
- CurTraceBuf = (long *) ShmemInitStruct("Buffer trace",
- (BMT_LIMIT * sizeof(bmtrace)) + sizeof(long),
- &foundDescs);
- if (!foundDescs)
- MemSet(CurTraceBuf, 0, (BMT_LIMIT * sizeof(bmtrace)) + sizeof(long));
-
- TraceBuf = (bmtrace *) & (CurTraceBuf[1]);
-#endif
-
BufferDescriptors = (BufferDesc *)
ShmemInitStruct("Buffer Descriptors",
Data_Descriptors * sizeof(BufferDesc), &foundDescs);
@@ -256,9 +235,5 @@ BufferShmemSize(void)
/* size of buffer hash table */
size += hash_estimate_size(NBuffers, sizeof(BufferLookupEnt));
-#ifdef BMTRACE
- size += (BMT_LIMIT * sizeof(bmtrace)) + sizeof(long);
-#endif
-
return size;
}