memcall: github.com/awnumar/memcall Index | Files

package memcall

import "github.com/awnumar/memcall"

Index

Package Files

memcall.go memcall_unix.go

Constants

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

ErrInvalidFlag indicates that a given memory protection flag is undefined.

func Alloc Uses

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

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

func DisableCoreDumps Uses

func DisableCoreDumps() error

DisableCoreDumps disables core dumps on Unix systems.

func Free Uses

func Free(b []byte) error

Free deallocates the byte slice specified.

func Lock Uses

func Lock(b []byte) error

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

func Protect Uses

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

Protect modifies the protection state for a specified byte slice.

func Unlock Uses

func Unlock(b []byte) error

Unlock is a wrapper for munlock(2).

type MemoryProtectionFlag Uses

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

MemoryProtectionFlag specifies some particular memory protection flag.

func NoAccess Uses

func NoAccess() MemoryProtectionFlag

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

func ReadOnly Uses

func ReadOnly() MemoryProtectionFlag

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

func ReadWrite Uses

func ReadWrite() MemoryProtectionFlag

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

Package memcall imports 4 packages (graph) and is imported by 3 packages. Updated 2019-10-04. Refresh now. Tools for package owners.