From 153372abd4adbcdb0a8be7eecddcfe5b5c885d9f Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Fri, 17 Jan 2014 15:23:39 -0700 Subject: Refactoring to RWCursor, RWTxn, and branch/leaf nodes and pages. --- db.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'db.go') diff --git a/db.go b/db.go index af946e3..480d059 100644 --- a/db.go +++ b/db.go @@ -45,9 +45,8 @@ type DB struct { mmapSize int /**< size of the data memory map */ size int /**< current file size */ pbuf []byte - transaction *Transaction /**< current write transaction */ + transaction *RWTransaction /**< current write transaction */ maxPageNumber int /**< me_mapsize / me_psize */ - pagestate pagestate /**< state of old pages from freeDB */ dpages []*page /**< list of malloc'd blocks for re-use */ freePages []int /** IDL of pages that became unused in a write txn */ dirtyPages []int /** ID2L of pages written during a write txn. Length MDB_IDL_UM_SIZE. */ @@ -223,6 +222,8 @@ func (db *DB) Transaction(writable bool) (*Transaction, error) { db: db, meta: db.meta(), writable: writable, + buckets: make(map[string]*Bucket), + cursors: make(map[uint32]*Cursor), } // Save references to the sys•free and sys•buckets buckets. -- cgit v1.2.3