memcall

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 6

README

memcall

Cirrus CI GoDoc Go Report Card

This package provides a cross-platform wrapper over some common memory-related system calls.

Please report any issues that you experience.

Documentation

Index

Constants

View Source
const ErrInvalidFlag = "<memcall> memory protection flag is undefined"

ErrInvalidFlag indicates that a given memory protection flag is undefined.

Variables

This section is empty.

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

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

MemoryProtectionFlag specifies some particular memory protection flag.

func NoAccess

func NoAccess() MemoryProtectionFlag

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

func ReadOnly

func ReadOnly() MemoryProtectionFlag

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

func ReadWrite

func ReadWrite() MemoryProtectionFlag

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

Jump to

Keyboard shortcuts

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