From 6f3743e1871d631780c84508516198f57e8db834 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 9 Mar 2022 08:49:20 +0000 Subject: [PATCH] more TDB --- source/libs/tdb/src/inc/tdbPage.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/libs/tdb/src/inc/tdbPage.h b/source/libs/tdb/src/inc/tdbPage.h index e85660ab33..be412e635c 100644 --- a/source/libs/tdb/src/inc/tdbPage.h +++ b/source/libs/tdb/src/inc/tdbPage.h @@ -31,7 +31,7 @@ typedef struct __attribute__((__packed__)) { struct SPage { pthread_spinlock_t lock; - void *pData; + u8 *pData; SPgid pgid; // Fields used by SPCache @@ -49,6 +49,10 @@ struct SPage { int aiOvfl[4]; }; +// Macros +#define TDB_PAGE_CELL_IDX_AT(pPage, idx) ((pPage)->aCellIdx[idx]) +#define TDB_PAGE_CELL_AT(pPage, idx) ((pPage)->pData + TDB_PAGE_CELL_IDX_AT(pPage, idx)) + // For page lock #define P_LOCK_SUCC 0 #define P_LOCK_BUSY 1 -- GitLab