mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
core/vm: clear memory
This commit is contained in:
parent
8c5a76e541
commit
c51e1b54a5
1 changed files with 1 additions and 0 deletions
|
|
@ -44,6 +44,7 @@ func (m *Memory) Free() {
|
||||||
// To reduce peak allocation, return only smaller memory instances to the pool.
|
// To reduce peak allocation, return only smaller memory instances to the pool.
|
||||||
const maxBufferSize = 16 << 10
|
const maxBufferSize = 16 << 10
|
||||||
if cap(m.store) <= maxBufferSize {
|
if cap(m.store) <= maxBufferSize {
|
||||||
|
clear(m.store)
|
||||||
m.store = m.store[:0]
|
m.store = m.store[:0]
|
||||||
m.lastGasCost = 0
|
m.lastGasCost = 0
|
||||||
memoryPool.Put(m)
|
memoryPool.Put(m)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue