releasePage() is now a function, not a function pointer. releasePageImpl is the name of the new function pointer.

This commit is contained in:
Sears Russell 2007-08-14 01:20:08 +00:00
parent 9745d62887
commit 8367dfe9a3
4 changed files with 15 additions and 5 deletions

View file

@ -125,7 +125,7 @@ static void bufManSimulateBufferManagerCrash();
static int bufManBufInit() { static int bufManBufInit() {
releasePage = bufManReleasePage; releasePageImpl = bufManReleasePage;
loadPageImpl = bufManLoadPage; loadPageImpl = bufManLoadPage;
writeBackPage = pageWrite; writeBackPage = pageWrite;
forcePages = forcePageFile; forcePages = forcePageFile;
@ -503,7 +503,7 @@ static compensated_function Page *bufManLoadPage(int xid, int pageid) {
} }
Page * (*loadPageImpl)(int xid, int pageid) = 0; Page * (*loadPageImpl)(int xid, int pageid) = 0;
void (*releasePage)(Page * p) = 0; void (*releasePageImpl)(Page * p) = 0;
void (*writeBackPage)(Page * p) = 0; void (*writeBackPage)(Page * p) = 0;
void (*forcePages)() = 0; void (*forcePages)() = 0;
void (*bufDeinit)() = 0; void (*bufDeinit)() = 0;
@ -519,6 +519,10 @@ Page * loadPage(int xid, int pageid) {
} }
void releasePage(Page * p) {
releasePageImpl(p);
}
int bufInit(int type) { int bufInit(int type) {
bufferManagerType = type; bufferManagerType = type;
static int lastType = 0; static int lastType = 0;

View file

@ -319,7 +319,7 @@ void bhBufInit() {
#endif #endif
loadPageImpl = bhLoadPageImpl; loadPageImpl = bhLoadPageImpl;
releasePage = bhReleasePage; releasePageImpl = bhReleasePage;
writeBackPage = bhWriteBackPage; writeBackPage = bhWriteBackPage;
forcePages = bhForcePages; forcePages = bhForcePages;
bufDeinit = bhBufDeinit; bufDeinit = bhBufDeinit;

View file

@ -58,7 +58,7 @@ static void paBufDeinit() {
void paBufInit () { void paBufInit () {
releasePage = paReleasePage; releasePageImpl = paReleasePage;
loadPageImpl = paLoadPage; loadPageImpl = paLoadPage;
writeBackPage = paWriteBackPage; writeBackPage = paWriteBackPage;
forcePages = paForcePages; forcePages = paForcePages;

View file

@ -126,7 +126,13 @@ extern Page * (*loadPageImpl)(int xid, int pageid);
loadPage aquires a lock when it is called, effectively pinning it loadPage aquires a lock when it is called, effectively pinning it
in memory. releasePage releases this lock. in memory. releasePage releases this lock.
*/ */
extern void (*releasePage)(Page * p); void releasePage(Page *p);
/**
This is the function pointer that bufInit sets in order to
override releasePage.
*/
extern void (*releasePageImpl)(Page * p);
/** /**
* initialize buffer manager * initialize buffer manager
* @return 0 on success * @return 0 on success