memmap

package
v0.0.0-...-f6902ab Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileSize

func GetFileSize(filename string) int64

GetFileSize is a helper function to retrieve file size

Types

type File

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

File is the wrapper around memory mapped file

func MapExisting

func MapExisting(filename string, offset int64, length int) (*File, error)

MapExisting is the factory method used to create memory maps for existing file. This function will fail if the file does not exist.

func NewFile

func NewFile(filename string, offset int64, length int) (*File, error)

NewFile is a factory method to create a new memory mapped file with the specified capacity

func (*File) Close

func (mmap *File) Close() (err error)

Close attempts to unmap the mapped memory region

func (*File) GetMemoryPtr

func (mmap *File) GetMemoryPtr() unsafe.Pointer

GetMemoryPtr return the pointer to the mapped region of the file

func (*File) GetMemorySize

func (mmap *File) GetMemorySize() int

GetMemorySize return the size of the mapped region of the file

Jump to

Keyboard shortcuts

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