Documentation ¶
Index ¶
- Constants
- func NewThread(e *EdfFile, name string) *thread
- type EdfFile
- func (e *EdfFile) AllocPages(pagesRequested uint32, thread uint32) (edfRange, error)
- func (e *EdfFile) FindThread(targetName string) (uint32, error)
- func (e *EdfFile) GetPageSize() uint64
- func (e *EdfFile) GetThreads() (map[uint32]string, error)
- func (e *EdfFile) ResolveRange(r edfRange) [][]byte
- func (e *EdfFile) WriteThread(t *thread) error
Constants ¶
View Source
const ( // EDF_VERSION is the file format version EDF_VERSION = 1 // EDF_LENGTH is th number of OS pages in each slice EDF_LENGTH = 32 // EDF_SIZE sets the maximum size of the mapping, represented with // EDF_LENGTH segments // Currently set arbitrarily to 128 MiB EDF_SIZE = 128 * (1024 * 1024) )
View Source
const ( // EDF_READ_ONLY means the file will only be read, modifications fail EDF_READ_ONLY = iota // EDF_READ_WRITE specifies that the file will be read and written EDF_READ_WRITE // EDF_CREATE means the file will be created and opened with EDF_READ_WRITE EDF_CREATE )
View Source
const ( // EDF_UNMAP_NOSYNC means the file won't be // Sync'd to disk before unmapping EDF_UNMAP_NOSYNC = iota // EDF_UNMAP_SYNC synchronises the EDF file to disk // during unmapping EDF_UNMAP_SYNC )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EdfFile ¶
type EdfFile struct {
// contains filtered or unexported fields
}
EdfFile represents a mapped file on disk or and anonymous mapping for instance storage
func EdfAnonMap ¶
EdfAnonMap maps the EdfFile structure into RAM IMPORTANT: everything's lost if unmapped
func (*EdfFile) AllocPages ¶
AllocPages allocates a |pagesRequested| chunk of pages on the thread with the given identifier. Returns an edfRange describing the result.
func (*EdfFile) FindThread ¶
FindThread obtains the index of a thread in the EdfFile.
func (*EdfFile) GetPageSize ¶
GetPageSize returns the pageSize of an EdfFile
func (*EdfFile) GetThreads ¶
GetThreads returns the thread identifier -> name map.
func (*EdfFile) ResolveRange ¶
ResolveRange returns a slice of byte slices representing the underlying memory referenced by edfRange.
WARNING: slow.
func (*EdfFile) WriteThread ¶
WriteThread inserts a new thread into the EdfFile.
Click to show internal directories.
Click to hide internal directories.