memcall

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(c Cleaner, b []byte) (err error)

Clean attempts to clean b using c and groups any errors into a single return value err.

Types

type Allocator

type Allocator interface {
	Alloc(size int) ([]byte, error)
}

type Cleaner

type Cleaner interface {
	Freer
	Unlocker
}

Cleaner is the interface that groups the basic Free and Unlock methods.

type Freer

type Freer interface {
	Free([]byte) error
}

type Interface

type Interface interface {
	Allocator
	Freer
	Protector
	Locker
	Unlocker
}

Interface provides an interface for wrapping memcall functions.

var Default Interface = &wrapper{}

Default is a default implementation of Interface that directly wraps functions exported by the memcall package.

type Locker

type Locker interface {
	Lock([]byte) error
}

type MemoryProtectionFlag

type MemoryProtectionFlag = memcall.MemoryProtectionFlag

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.

type Protector

type Protector interface {
	Protect([]byte, MemoryProtectionFlag) error
}

type Unlocker

type Unlocker interface {
	Unlock([]byte) error
}

Jump to

Keyboard shortcuts

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