提交 77af8e6b 编写于 作者: H Hongze Cheng

more TDB

上级 40d18c4a
......@@ -20,6 +20,11 @@ typedef struct __attribute__((__packed__)) {
u16 nOffset;
} SFreeCell;
typedef struct __attribute__((__packed__)) {
u8 size[3];
u8 nOffset[3];
} SFreeCellL;
static int tdbPageAllocate(SPage *pPage, int size, SCell **ppCell);
static int tdbPageDefragment(SPage *pPage);
......@@ -46,9 +51,11 @@ int tdbPageCreate(int pageSize, SPage **ppPage, void *(*xMalloc)(void *, size_t)
if (pageSize < 65536) {
pPage->szOffset = 2;
pPage->szPageHdr = sizeof(SPageHdr);
pPage->szFreeCell = sizeof(SFreeCell);
} else {
pPage->szOffset = 3;
pPage->szPageHdr = sizeof(SLPageHdr);
pPage->szFreeCell = sizeof(SFreeCellL);
}
TDB_INIT_PAGE_LOCK(pPage);
......
......@@ -50,6 +50,7 @@ struct SPage {
int pageSize;
u8 szOffset;
u8 szPageHdr;
u8 szFreeCell;
pthread_spinlock_t lock;
// Fields below used by pager and am
u8 *pPageHdr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册