memcall

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFlag = errors.New("<memguard::memcall> memory protection flag is undefined")

ErrInvalidFlag indicates that a given memory protection flag is undefined.

View Source
var NoAccess = MemoryProtectionFlag{1}

NoAccess specifies that the memory should be marked unreadable and immutable.

View Source
var ReadOnly = MemoryProtectionFlag{2}

ReadOnly specifies that the memory should be marked read-only (immutable).

View Source
var ReadWrite = MemoryProtectionFlag{6}

ReadWrite specifies that the memory should be made readable and writable.

Functions

func Alloc

func Alloc(n int) ([]byte, error)

Alloc allocates a byte slice of length n and returns it.

func DisableCoreDumps

func DisableCoreDumps() error

DisableCoreDumps disables core dumps on Unix systems.

func Free

func Free(b []byte) error

Free deallocates the byte slice specified.

func Lock

func Lock(b []byte) error

Lock is a wrapper for mlock(2), with extra precautions.

func Protect

func Protect(b []byte, mpf MemoryProtectionFlag) error

Protect modifies the protection state for a specified byte slice.

func Unlock

func Unlock(b []byte) error

Unlock is a wrapper for munlock(2).

Types

type MemoryProtectionFlag added in v0.16.0

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

MemoryProtectionFlag specifies some particular memory protection flag.

Jump to

Keyboard shortcuts

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