Documentation
¶
Index ¶
- Constants
- func GetPageSize() uint64
- func RoundDown(addr uint64, size uint64) uint64
- func RoundUp(addr uint64, size uint64) uint64
- type Memory
- func (m *Memory) Addr() uint64
- func (m *Memory) Clear()
- func (m *Memory) Free()
- func (m *Memory) Protect(addr, size uint64, protect int) error
- func (m *Memory) Read(b []byte) (n int, err error)
- func (m *Memory) ReadAt(b []byte, off int64) (n int, err error)
- func (m *Memory) Seek(offset int64, whence int) (int64, error)
- func (m *Memory) Write(b []byte) (n int, err error)
- func (m *Memory) WriteAt(b []byte, off int64) (n int, err error)
Constants ¶
View Source
const ( MemCommit = 0x00001000 MemReserve = 0x00002000 MemReset = 0x00080000 MemResetUndo = 0x10000000 )
Enumeration of allocation type values.
View Source
const ( PageNoAccess = 0x01 PageReadOnly = 0x02 PageReadWrite = 0x04 PageWriteCopy = 0x08 PageExecute = 0x10 PageExecuteRead = 0x20 PageExecuteReadWrite = 0x40 PageExecuteWriteCopy = 0x80 )
Enumeration of protection levels.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory represents a raw block of memory.
func Alloc ¶
Alloc allocates memory at addr of size with allocType and protect. It returns nil if it fails.
func Get ¶
Get returns a range of existing memory. If the range is not a block of allocated memory, the returned memory will pagefault when accessed.
Click to show internal directories.
Click to hide internal directories.