vmcache

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLruSize = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type VmCache

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

func NewVmCache

func NewVmCache() *VmCache

func (*VmCache) Contains

func (v *VmCache) Contains(owner, contract string, codeHash []byte) int

Contains returns number of cached VM instances for the given contract.

func (*VmCache) Fetch

func (v *VmCache) Fetch(owner, contract string, codeHash []byte) (vm *exec.VM)

Fetch fetches a cached VM instance for given contract. It returns nil if no cached instance for the contract was found.

func (*VmCache) Len

func (v *VmCache) Len() int

Len returns total number of cached VM instances.

func (*VmCache) Put

func (v *VmCache) Put(owner, contract string, codeHash []byte, vm *exec.VM)

Put adds a VM instance to the cache.

func (*VmCache) Remove

func (v *VmCache) Remove(owner, contract string, codeHash []byte)

Remove deletes all cached VM instances for the given contract.

Jump to

Keyboard shortcuts

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