提交 4c32e5e3 编写于 作者: H Hongze Cheng

refact TDB

上级 7c66b2df
......@@ -28,7 +28,7 @@ struct SBTree {
SPgno root;
int keyLen;
int valLen;
SPager * pPager;
SPager *pPager;
FKeyComparator kcmpr;
u8 fanout;
int pageSize;
......@@ -264,7 +264,7 @@ static int tdbEncodeLength(u8 *pBuf, uint32_t len) {
static int tdbBtCursorMoveToRoot(SBtCursor *pCur) {
SBTree *pBt;
SPager *pPager;
SPage * pPage;
SPage *pPage;
int ret;
pBt = pCur->pBt;
......
......@@ -16,16 +16,16 @@
#include "tdbInt.h"
struct STDb {
STEnv * pEnv;
STEnv *pEnv;
SBTree *pBt;
};
int tdbDbOpen(const char *fname, int keyLen, int valLen, FKeyComparator keyCmprFn, STEnv *pEnv, STDb **ppDb) {
STDb * pDb;
STDb *pDb;
SPager *pPager;
int ret;
char fFullName[TDB_FILENAME_LEN];
SPage * pPage;
SPage *pPage;
SPgno pgno;
*ppDb = NULL;
......
......@@ -20,10 +20,10 @@ struct SPCache {
int extraSize;
pthread_mutex_t mutex;
int nFree;
SPage * pFree;
SPage *pFree;
int nPage;
int nHash;
SPage ** pgHash;
SPage **pgHash;
int nRecyclable;
SPage lru;
};
......@@ -49,8 +49,8 @@ static void tdbPCacheUnpinPage(SPage *pPage);
int tdbPCacheOpen(int pageSize, int cacheSize, int extraSize, SPCache **ppCache) {
SPCache *pCache;
void * pPtr;
SPage * pPgHdr;
void *pPtr;
SPage *pPgHdr;
pCache = (SPCache *)calloc(1, sizeof(*pCache));
if (pCache == NULL) {
......@@ -204,7 +204,7 @@ static void tdbPCacheUnpinPage(SPage *pPage) {
static void tdbPCacheRemovePageFromHash(SPage *pPage) {
SPCache *pCache;
SPage ** ppPage;
SPage **ppPage;
int h;
pCache = pPage->pCache;
......@@ -232,7 +232,7 @@ static void tdbPCacheAddPageToHash(SPage *pPage) {
static int tdbPCacheOpenImpl(SPCache *pCache) {
SPage *pPage;
u8 * pPtr;
u8 *pPtr;
int tsize;
tdbPCacheInitLock(pCache);
......
......@@ -16,8 +16,8 @@
#include "tdbInt.h"
struct SPager {
char * dbFileName;
char * jFileName;
char *dbFileName;
char *jFileName;
int pageSize;
uint8_t fid[TDB_FILE_ID_LEN];
int fd;
......@@ -26,8 +26,8 @@ struct SPager {
SPgno dbFileSize;
SPgno dbOrigSize;
int nDirty;
SPage * pDirty;
SPage * pDirtyTail;
SPage *pDirty;
SPage *pDirtyTail;
u8 inTran;
};
......@@ -49,7 +49,7 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage
int tdbPagerOpen(SPCache *pCache, const char *fileName, SPager **ppPager) {
uint8_t *pPtr;
SPager * pPager;
SPager *pPager;
int fsize;
int zsize;
int ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册