mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
update comment
This commit is contained in:
parent
e4aa362e75
commit
f54bb270dd
1 changed files with 4 additions and 2 deletions
|
|
@ -26,13 +26,15 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// memoryGasCost calculates the quadratic gas for memory expansion. It does so
|
||||||
|
// only for the EVM memory region that is expanded, not the total memory.
|
||||||
func memoryGasCost(pc uint64, scope *ScopeContext, newMemSize uint64) (uint64, error) {
|
func memoryGasCost(pc uint64, scope *ScopeContext, newMemSize uint64) (uint64, error) {
|
||||||
return evmmaxMemoryGasCost(pc, scope, newMemSize, scope.modExtState.AllocSize())
|
return evmmaxMemoryGasCost(pc, scope, newMemSize, scope.modExtState.AllocSize())
|
||||||
}
|
}
|
||||||
|
|
||||||
// evmmaxMemory calculates the quadratic gas for memory expansion. It does so
|
// evmmaxMemoryGasCost calculates the quadratic gas for memory expansion. It does so
|
||||||
// only for the memory region that is expanded, not the total memory. It uses
|
// only for the memory region that is expanded, not the total memory. It uses
|
||||||
// the modified EVMMAX memory expansion rule: consider the size of memory to
|
// the modified EIP-6690 memory expansion rule: consider the size of memory to
|
||||||
// include EVM memory and the memory allocated by all active field contexts.
|
// include EVM memory and the memory allocated by all active field contexts.
|
||||||
func evmmaxMemoryGasCost(pc uint64, scope *ScopeContext, newMemSize uint64, newEVMMAXMemSize uint64) (uint64, error) {
|
func evmmaxMemoryGasCost(pc uint64, scope *ScopeContext, newMemSize uint64, newEVMMAXMemSize uint64) (uint64, error) {
|
||||||
if newMemSize == 0 && newEVMMAXMemSize == 0 {
|
if newMemSize == 0 && newEVMMAXMemSize == 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue