Documentation
¶
Index ¶
- type Allocator
- func (a *Allocator) Alloc(hint uint64) (uint64, error)
- func (a *Allocator) AllocMany(count int, hint uint64) ([]uint64, error)
- func (a *Allocator) Free(id uint64) error
- func (a *Allocator) Head() uint64
- func (a *Allocator) SetFreelistRegion(pages uint64, radius int)
- func (a *Allocator) SetHead(h uint64)
- func (a *Allocator) SetPreferAppend(prefer bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator struct {
// contains filtered or unexported fields
}
func (*Allocator) Alloc ¶
Alloc allocates a single page. hint is a page ID that the caller would like the new page to be close to. If hint is 0, the allocator uses its own heuristics (e.g. lastAlloc).
func (*Allocator) AllocMany ¶
AllocMany allocates up to count pages in one pass. It returns any allocated IDs even if an error occurs so callers can retire them.
func (*Allocator) SetFreelistRegion ¶
func (*Allocator) SetPreferAppend ¶
Click to show internal directories.
Click to hide internal directories.