mmap

package
v0.0.0-...-5dfeaac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnmappedMemory  = errors.New("unmapped memory")
	ErrIndexOutOfBound = errors.New("offset out of mapped region")
)

Functions

func Close

func Close(data []byte) error

func Open

func Open(path string, writable bool, length int64) (data []byte, err error)

length is provide when writable for creation

Types

type MMFile

type MMFile struct {
	// contains filtered or unexported fields
}

File reads/writes a memory-mapped file.

func (*MMFile) Close

func (m *MMFile) Close() error

func (*MMFile) Flush

func (m *MMFile) Flush(flags int) error

func (*MMFile) Len

func (m *MMFile) Len() int64

func (*MMFile) Open

func (m *MMFile) Open() error

func (*MMFile) ReadAt

func (m *MMFile) ReadAt(dest []byte, offset int64) (int, error)

func (*MMFile) ReadUint64At

func (m *MMFile) ReadUint64At(offset int64) uint64

func (*MMFile) WriteAt

func (m *MMFile) WriteAt(src []byte, offset int64) (int, error)

func (*MMFile) WriteUint64At

func (m *MMFile) WriteUint64At(num uint64, offset int64)

WriteUint64At writes num at offset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL