diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-24 16:32:18 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-24 16:32:18 -0700 |
commit | 73ab1d420dedd965ebe6f814dcf016c8e10879f2 (patch) | |
tree | 2a025e8e8daeaba34953c6b92b83bd579c83962b /rwtransaction.go | |
parent | TODO (diff) | |
download | dedo-73ab1d420dedd965ebe6f814dcf016c8e10879f2.tar.gz dedo-73ab1d420dedd965ebe6f814dcf016c8e10879f2.tar.xz |
TODO
Diffstat (limited to 'rwtransaction.go')
-rw-r--r-- | rwtransaction.go | 10 |
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 +} |