aboutsummaryrefslogtreecommitdiff
path: root/page.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-01-09 09:07:10 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-01-09 09:07:10 -0700
commitf922c1d2bc54beb529b9853b42124fb8328da732 (patch)
treea8dc592c50bee6117c7c43a3e9f8712bbe470658 /page.go
parentBasic types. (diff)
downloaddedo-f922c1d2bc54beb529b9853b42124fb8328da732.tar.gz
dedo-f922c1d2bc54beb529b9853b42124fb8328da732.tar.xz
Move all C code into repo.
Diffstat (limited to 'page.go')
-rw-r--r--page.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/page.go b/page.go
index 3f1e6b3..fe639fa 100644
--- a/page.go
+++ b/page.go
@@ -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
}
+