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

Method Set

core/vm/memory.go:38–49  ·  view source on GitHub ↗

Set sets offset + size to value

(offset, size uint64, value []byte)

Source from the content-addressed store, hash-verified

36
37// Set sets offset + size to value
38func (m *Memory) Set(offset, size uint64, value []byte) {
39 // It's possible the offset is greater than 0 and size equals 0. This is because
40 // the calcMemSize (common.go) could potentially return 0 when size is zero (NO-OP)
41 if size > 0 {
42 // length of store may never be less than offset + size.
43 // The store should be resized PRIOR to setting the memory
44 if offset+size > uint64(len(m.store)) {
45 panic("invalid memory: store empty")
46 }
47 copy(m.store[offset:offset+size], value)
48 }
49}
50
51// Set32 sets the 32 bytes starting at offset to the value of val, left-padded with zeroes to
52// 32 bytes.

Callers 15

RulesMethod · 0.45
Cep1BlockRewardSupplyY1Function · 0.45
Cep1BlockRewardSupplyY2Function · 0.45
Cep1BlockRewardSupplyY3Function · 0.45
Cep1BlockRewardSupplyY4Function · 0.45
Cep1BlockRewardSupplyY5Function · 0.45
Cep1BlockRewardY1Function · 0.45
Cep1BlockRewardY2Function · 0.45
Cep1BlockRewardY3Function · 0.45
Cep1BlockRewardY4Function · 0.45
Cep1BlockRewardY5Function · 0.45
Cep1LastBlockY1Function · 0.45

Calls

no outgoing calls

Tested by 7

testHTTPErrorResponseFunction · 0.36