diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-09 09:07:10 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-09 09:07:10 -0700 |
commit | f922c1d2bc54beb529b9853b42124fb8328da732 (patch) | |
tree | a8dc592c50bee6117c7c43a3e9f8712bbe470658 /page.go | |
parent | Basic types. (diff) | |
download | dedo-f922c1d2bc54beb529b9853b42124fb8328da732.tar.gz dedo-f922c1d2bc54beb529b9853b42124fb8328da732.tar.xz |
Move all C code into repo.
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 } + |