aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-04-21 07:24:48 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-04-21 07:24:48 -0600
commitafe8123d91e9b7e492fec95fad537f37d911f5d0 (patch)
tree9c59a10b225461923f594e8e9c8b374f0df09136 /db.go
parentMerge pull request #135 from benbjohnson/bench (diff)
parentall tests pass (diff)
downloaddedo-afe8123d91e9b7e492fec95fad537f37d911f5d0.tar.gz
dedo-afe8123d91e9b7e492fec95fad537f37d911f5d0.tar.xz
Merge pull request #134 from Shopify/c_cursor
C cursor
Diffstat (limited to 'db.go')
-rw-r--r--db.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/db.go b/db.go
index c9611f9..7e8dd7f 100644
--- a/db.go
+++ b/db.go
@@ -578,6 +578,12 @@ func (db *DB) checkBucket(b *Bucket, reachable map[pgid]*page, errors *ErrorList
})
}
+// This is for internal access to the raw data bytes from the C cursor, use
+// carefully, or not at all.
+func (db *DB) Info() *Info {
+ return &Info{db.data, db.pageSize}
+}
+
// page retrieves a page reference from the mmap based on the current page size.
func (db *DB) page(id pgid) *page {
pos := id * pgid(db.pageSize)
@@ -641,3 +647,8 @@ func (s *Stats) Sub(other *Stats) Stats {
func (s *Stats) add(other *Stats) {
s.TxStats.add(&other.TxStats)
}
+
+type Info struct {
+ Data []byte
+ PageSize int
+}