提交 737497d8 编写于 作者: H Hongze Cheng

more TDB

上级 c41db68c
......@@ -136,11 +136,10 @@ typedef int (*FKeyComparator)(const void *pKey1, int kLen1, const void *pKey2, i
typedef struct SPager SPager;
typedef struct SPCache SPCache;
typedef struct SPage SPage;
#include "tdbUtil.h"
#include "tdbPage.h"
#include "tdbPCache.h"
#include "tdbPager.h"
......@@ -151,6 +150,8 @@ typedef struct SPCache SPCache;
#include "tdbDb.h"
#include "tdbPage.h"
#ifdef __cplusplus
}
#endif
......
......@@ -20,7 +20,18 @@
extern "C" {
#endif
#define TDB_PCACHE_PAGE
#define TDB_PCACHE_PAGE \
u8 isAnchor; \
u8 isLocalPage; \
u8 isDirty; \
i32 nRef; \
SPCache *pCache; \
SPage *pFreeNext; \
SPage *pHashNext; \
SPage *pLruNext; \
SPage *pLruPrev; \
SPage *pDirtyNext; \
SPager *pPager;
int tdbPCacheOpen(int pageSize, int cacheSize, int extraSize, SPCache **ppCache);
int tdbPCacheClose(SPCache *pCache);
......
......@@ -29,23 +29,14 @@ typedef struct __attribute__((__packed__)) {
SPgno rChild;
} SPageHdr;
typedef struct SPage SPage;
struct SPage {
pthread_spinlock_t lock;
// Fields below used by page cache
void *pData;
SPgid pgid;
u8 isAnchor;
u8 isLocalPage;
u8 isDirty;
i32 nRef;
SPCache *pCache;
SPage *pFreeNext;
SPage *pHashNext;
SPage *pLruNext;
SPage *pLruPrev;
SPage *pDirtyNext;
SPager *pPager;
// Fields used by SPCache
TDB_PCACHE_PAGE
// Fields below used by pager and am
SPageHdr *pPageHdr;
u16 *aCellIdx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册