more refact

This commit is contained in:
Hongze Cheng 2022-02-23 06:09:20 +00:00
parent 1e5c2688db
commit 9916d2483c
3 changed files with 5 additions and 3 deletions

View File

@ -42,7 +42,7 @@ static void tdbPCachePinPage(SPgHdr *pPage);
static void tdbPCacheRemovePageFromHash(SPgHdr *pPage); static void tdbPCacheRemovePageFromHash(SPgHdr *pPage);
static void tdbPCacheAddPageToHash(SPgHdr *pPage); static void tdbPCacheAddPageToHash(SPgHdr *pPage);
int tdbOpenPCache(int pageSize, int cacheSize, int extraSize, SPCache **ppCache) { int tdbPCacheOpen(int pageSize, int cacheSize, int extraSize, SPCache **ppCache) {
SPCache *pCache; SPCache *pCache;
void * pPtr; void * pPtr;
SPgHdr * pPgHdr; SPgHdr * pPgHdr;
@ -74,7 +74,7 @@ int tdbOpenPCache(int pageSize, int cacheSize, int extraSize, SPCache **ppCache)
return 0; return 0;
} }
int tdbClosePCache(SPCache *pCache) { int tdbPCacheClose(SPCache *pCache) {
/* TODO */ /* TODO */
return 0; return 0;
} }

View File

@ -36,7 +36,7 @@ struct SPgHdr {
SPgHdr * pLruPrev; SPgHdr * pLruPrev;
}; };
int tdbOpenPCache(int pageSize, int cacheSize, int extraSize, SPCache **ppCache); int tdbPCacheOpen(int pageSize, int cacheSize, int extraSize, SPCache **ppCache);
int tdbPCacheClose(SPCache *pCache); int tdbPCacheClose(SPCache *pCache);
SPgHdr *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, bool alcNewPage); SPgHdr *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, bool alcNewPage);
void tdbFetchFinish(SPCache *pCache, SPgHdr *pPage); void tdbFetchFinish(SPCache *pCache, SPgHdr *pPage);

View File

@ -20,6 +20,8 @@
extern "C" { extern "C" {
#endif #endif
typedef struct SPFile SPFile;
// typedef struct __attribute__((__packed__)) { // typedef struct __attribute__((__packed__)) {
// char hdrInfo[16]; // info string // char hdrInfo[16]; // info string
// pgsz_t szPage; // page size of current file // pgsz_t szPage; // page size of current file