| Copyright | (c) 2015 Călin Ardelean |
|---|---|
| License | MIT |
| Maintainer | Călin Ardelean <calinucs@gmail.com> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Database.Muesli.Allocator
Description
Document data allocator.
This module should be imported qualified.
- empty :: DocAddress -> GapsIndex
- add :: DocSize -> DocAddress -> GapsIndex -> GapsIndex
- build :: MainIndex -> GapsIndex
- buildExtra :: DocAddress -> [LogRecord] -> GapsIndex
- alloc :: GapsIndex -> DocSize -> (DocAddress, GapsIndex)
Documentation
empty :: DocAddress -> GapsIndex Source
Creates an index holding a single gap starting at the given address.
buildExtra :: DocAddress -> [LogRecord] -> GapsIndex Source
Builds the index from a set of LogRecords, with all space before the
given address considered reserved.
Used by the garbage collector (see module Database.Muesli.GC).
alloc :: GapsIndex -> DocSize -> (DocAddress, GapsIndex) Source
Allocates a new slot of the given size. The smallest available size in the index is preferred.
Throws DataAllocationError if no gap big enough is found.