This commit is contained in:
Hongze Cheng 2022-03-11 08:14:54 +00:00
parent 2b0fa6d9c8
commit 6da314df7c
2 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,8 @@ extern "C" {
SPage *pLruNext; \ SPage *pLruNext; \
SPage *pLruPrev; \ SPage *pLruPrev; \
SPage *pDirtyNext; \ SPage *pDirtyNext; \
SPager *pPager; SPager *pPager; \
SPgid pgid;
int tdbPCacheOpen(int pageSize, int cacheSize, SPCache **ppCache); int tdbPCacheOpen(int pageSize, int cacheSize, SPCache **ppCache);
int tdbPCacheClose(SPCache *pCache); int tdbPCacheClose(SPCache *pCache);

View File

@ -22,6 +22,7 @@ extern "C" {
typedef u8 SCell; typedef u8 SCell;
// Page header
typedef struct __attribute__((__packed__)) { typedef struct __attribute__((__packed__)) {
u16 flags; u16 flags;
u16 nCells; u16 nCells;
@ -30,6 +31,7 @@ typedef struct __attribute__((__packed__)) {
u16 nFree; u16 nFree;
} SPageHdr; } SPageHdr;
// Large page header (pageSize >= 65536 (64K))
typedef struct __attribute__((__packed__)) { typedef struct __attribute__((__packed__)) {
u16 flags; u16 flags;
u8 nCells[3]; u8 nCells[3];
@ -48,7 +50,6 @@ struct SPage {
u8 szOffset; u8 szOffset;
pthread_spinlock_t lock; pthread_spinlock_t lock;
// Fields below used by pager and am // Fields below used by pager and am
SPgid pgid;
SPageHdr *pPageHdr; SPageHdr *pPageHdr;
SPageFtr *pPageFtr; SPageFtr *pPageFtr;
u8 *aCellIdx; u8 *aCellIdx;