This patch extracts page buffer pooling and the simple
authorBruce Momjian <bruce@momjian.us>
Wed, 11 Jun 2003 22:37:46 +0000 (22:37 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 11 Jun 2003 22:37:46 +0000 (22:37 +0000)
commit0abe7431c6d7a022e7f24a4f145c702900f56174
tree86af2971d8eb0bb48b9622abc0db40f8186b881a
parent240dc5cddc8c5fd13fbf8196034436183ed61a2f
This patch extracts page buffer pooling and the simple
least-recently-used strategy from clog.c into slru.c.  It doesn't
change any visible behaviour and passes all regression tests plus a
TruncateCLOG test done manually.

Apart from refactoring I made a little change to SlruRecentlyUsed,
formerly ClogRecentlyUsed:  It now skips incrementing lru_counts, if
slotno is already the LRU slot, thus saving a few CPU cycles.  To make
this work, lru_counts are initialised to 1 in SimpleLruInit.

SimpleLru will be used by pg_subtrans (part of the nested transactions
project), so the main purpose of this patch is to avoid future code
duplication.

Manfred Koizar
src/backend/access/transam/Makefile
src/backend/access/transam/clog.c
src/backend/access/transam/slru.c [new file with mode: 0644]
src/backend/storage/lmgr/lwlock.c
src/include/access/slru.h [new file with mode: 0644]
src/include/storage/lwlock.h