aboutsummaryrefslogtreecommitdiff
path: root/rwtransaction.go
diff options
context:
space:
mode:
Diffstat (limited to 'rwtransaction.go')
-rw-r--r--rwtransaction.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/rwtransaction.go b/rwtransaction.go
index cb0cc0f..f28c8b2 100644
--- a/rwtransaction.go
+++ b/rwtransaction.go
@@ -6,7 +6,7 @@ type RWTransaction struct {
Transaction
dirtyPages map[int]*page
- freePages map[int]*page
+ freelist []pgno
}
// TODO: Allocate scratch meta page.
@@ -95,7 +95,6 @@ func (t *Transaction) Put(name string, key []byte, value []byte) error {
return c.Put(key, value)
}
-
// page returns a reference to the page with a given id.
// If page has been written to then a temporary bufferred page is returned.
func (t *Transaction) page(id int) *page {
@@ -127,3 +126,10 @@ func (t *RWTransaction) DeleteBucket(name string) error {
return nil
}
+
+// allocate returns a contiguous block of memory starting at a given page.
+func (t *RWTransaction) allocate(count int) (*page, error) {
+ // TODO: Find a continuous block of free pages.
+ // TODO: If no free pages are available, resize the mmap to allocate more.
+ return nil, nil
+}