shm

package
v0.0.0-...-2f2df4f Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package shm provides helpers for dealing with shared memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create() (*os.File, error)

Create returns a file that can be mmapped to share memory with another process. It is possible for it to return both a valid file and an error.

Types

type Mmap

type Mmap []byte

Mmap is a []byte that represents a mmapped file.

func MapPrivate

func MapPrivate(file *os.File, size int, prot int) (Mmap, error)

MapPrivate maps file into memory at the given size with the given prot. It maps it in private mode, meaning that writes to the memory will not be reflected in the file.

func MapShared

func MapShared(file *os.File, size int, prot int) (Mmap, error)

MapShared maps file into memory at the given size with the given prot. It maps it in shared mode, meaning that writes to the memory will be reflected in the file.

func (Mmap) Unmap

func (mmap Mmap) Unmap() error

Unmap unmaps mmap.

Jump to

Keyboard shortcuts

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