Documentation ¶
Index ¶
- Constants
- func HashPair(left, right [32]byte) [32]byte
- type CachedPage
- type Memory
- func (m *Memory) AllocPage(pageIndex uint32) *CachedPage
- func (m *Memory) ForEachPage(fn func(pageIndex uint32, page *Page) error) error
- func (m *Memory) GetMemory(addr uint32) uint32
- func (m *Memory) Invalidate(addr uint32)
- func (m *Memory) MarshalJSON() ([]byte, error)
- func (m *Memory) MerkleProof(addr uint32) (out [MEM_PROOF_SIZE]byte)
- func (m *Memory) MerkleRoot() [32]byte
- func (m *Memory) MerkleizeSubtree(gindex uint64) [32]byte
- func (m *Memory) PageCount() int
- func (m *Memory) ReadMemoryRange(addr uint32, count uint32) io.Reader
- func (m *Memory) SetMemory(addr uint32, v uint32)
- func (m *Memory) SetMemoryRange(addr uint32, r io.Reader) error
- func (m *Memory) UnmarshalJSON(data []byte) error
- func (m *Memory) Usage() string
- func (m *Memory) UsageRaw() uint64
- type Page
Constants ¶
View Source
const ( PageAddrSize = 12 PageKeySize = 32 - PageAddrSize PageSize = 1 << PageAddrSize PageAddrMask = PageSize - 1 MaxPageCount = 1 << PageKeySize PageKeyMask = MaxPageCount - 1 )
Note: 2**12 = 4 KiB, the min phys page size in the Go runtime.
View Source
const MEM_PROOF_SIZE = 28 * 32
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CachedPage ¶
type CachedPage struct { Data *Page // intermediate nodes only Cache [PageSize / 32][32]byte // true if the intermediate node is valid Ok [PageSize / 32]bool }
func (*CachedPage) Invalidate ¶
func (p *CachedPage) Invalidate(pageAddr uint32)
func (*CachedPage) InvalidateFull ¶
func (p *CachedPage) InvalidateFull()
func (*CachedPage) MerkleRoot ¶
func (p *CachedPage) MerkleRoot() [32]byte
func (*CachedPage) MerkleizeSubtree ¶
func (p *CachedPage) MerkleizeSubtree(gindex uint64) [32]byte
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func (*Memory) AllocPage ¶
func (m *Memory) AllocPage(pageIndex uint32) *CachedPage
func (*Memory) ForEachPage ¶
func (*Memory) Invalidate ¶
func (*Memory) MarshalJSON ¶
func (*Memory) MerkleProof ¶
func (m *Memory) MerkleProof(addr uint32) (out [MEM_PROOF_SIZE]byte)
func (*Memory) MerkleRoot ¶
func (*Memory) MerkleizeSubtree ¶
func (*Memory) ReadMemoryRange ¶
func (*Memory) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.