was in the thread "make BufferGetBlockNumber() a macro". Tom
objected to the original patch, so I prepared a new one which
doesn't change BufferGetBlockNumber() into a macro, it just
cleans up some comments and fixes an assertion. The patch
is attached.
Neil Conway
BlockNumber
BufferGetBlockNumber(Buffer buffer)
{
- Assert(BufferIsValid(buffer));
+ Assert(BufferIsPinned(buffer));
if (BufferIsLocal(buffer))
return LocalBufferDescriptors[-buffer - 1].tag.blockNum;
*/
#define BufferIsLocal(buffer) ((buffer) < 0)
-/*
- * If NO_BUFFERISVALID is defined, all error checking using BufferIsValid()
- * are suppressed. Decision-making using BufferIsValid is not affected.
- * This should be set only if one is sure there will be no errors.
- * - plai 9/10/90
- */
-#undef NO_BUFFERISVALID
-
#endif /* BUF_H */
#define BUFFER_LOCK_SHARE 1
#define BUFFER_LOCK_EXCLUSIVE 2
-
-/**********************************************************************
-
- the rest is function defns in the bufmgr that are externally callable
-
- **********************************************************************/
-
/*
* These routines are beaten on quite heavily, hence the macroization.
*/
BufferBlockPointers[(buffer) - 1] \
)
-
/*
* prototypes for functions in bufmgr.c
*/