diff options
Diffstat (limited to 'page.go')
-rw-r--r-- | page.go | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -17,6 +17,26 @@ const ( KeepPage = 0x8000 /**< leave this page alone during spill */ ) +// maxCommitPages is the maximum number of pages to commit in one writev() call. +const maxCommitPages 64 + +/* max bytes to write in one call */ +const maxWriteByteCount 0x80000000U // TODO: #define MAX_WRITE 0x80000000U >> (sizeof(ssize_t) == 4)) + +// TODO: +// #if defined(IOV_MAX) && IOV_MAX < MDB_COMMIT_PAGES +// #undef MDB_COMMIT_PAGES +// #define MDB_COMMIT_PAGES IOV_MAX +// #endif + +// TODO: #define MDB_PS_MODIFY 1 +// TODO: #define MDB_PS_ROOTONLY 2 +// TODO: #define MDB_PS_FIRST 4 +// TODO: #define MDB_PS_LAST 8 + +// TODO: #define MDB_SPLIT_REPLACE MDB_APPENDDUP /**< newkey is not new */ + + type page struct { header struct { id int @@ -28,6 +48,11 @@ type page struct { metadata []byte } +type pageState struct { + head int /**< Reclaimed freeDB pages, or NULL before use */ + last int /**< ID of last used record, or 0 if !mf_pghead */ +} + // nodeCount returns the number of nodes on the page. func (p *page) nodeCount() int { return 0 // (p.header.lower - unsafe.Sizeof(p.header) >> 1 @@ -42,3 +67,4 @@ func (p *page) remainingSize() int { func (p *page) remainingSize() int { return p.header.upper - p.header.lower } + |