more TDB
This commit is contained in:
parent
c41db68c6a
commit
737497d8b6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue