MCPcopy Create free account
hub / github.com/CPChain/chain / Resize

Method Resize

core/vm/memory.go:66–70  ·  view source on GitHub ↗

Resize resizes the memory to size

(size uint64)

Source from the content-addressed store, hash-verified

64
65// Resize resizes the memory to size
66func (m *Memory) Resize(size uint64) {
67 if uint64(m.Len()) < size {
68 m.store = append(m.store, make([]byte, size-uint64(m.Len()))...)
69 }
70}
71
72// Get returns offset + size as a new slice
73func (m *Memory) Get(offset, size int64) (cpy []byte) {

Callers 3

RunMethod · 0.80
TestOpMstoreFunction · 0.80
BenchmarkOpMstoreFunction · 0.80

Calls 1

LenMethod · 0.95

Tested by 2

TestOpMstoreFunction · 0.64
BenchmarkOpMstoreFunction · 0.64