mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
reduce number of heap allocations in tracing (#958)
This commit is contained in:
parent
58ed1a2a3b
commit
ddf94b3e5a
2 changed files with 0 additions and 26 deletions
|
|
@ -92,24 +92,6 @@ type StructLogRes struct {
|
|||
RefundCounter uint64 `json:"refund,omitempty"`
|
||||
}
|
||||
|
||||
// NewStructLogResBasic Basic StructLogRes skeleton, Stack&Memory&Storage&ExtraData are separated from it for GC optimization;
|
||||
// still need to fill in with Stack&Memory&Storage&ExtraData
|
||||
func NewStructLogResBasic(pc uint64, op string, gas, gasCost uint64, depth int, refundCounter uint64, err error) *StructLogRes {
|
||||
logRes := &StructLogRes{
|
||||
Pc: pc,
|
||||
Op: op,
|
||||
Gas: gas,
|
||||
GasCost: gasCost,
|
||||
Depth: depth,
|
||||
RefundCounter: refundCounter,
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
logRes.Error = err.Error()
|
||||
}
|
||||
return logRes
|
||||
}
|
||||
|
||||
type AccountWrapper struct {
|
||||
Address common.Address `json:"address"`
|
||||
Nonce uint64 `json:"nonce"`
|
||||
|
|
|
|||
|
|
@ -80,14 +80,6 @@ type StructLog struct {
|
|||
Err error `json:"-"`
|
||||
}
|
||||
|
||||
func (s *StructLog) clean() {
|
||||
s.Memory = s.Memory[:0]
|
||||
s.Stack = s.Stack[:0]
|
||||
s.ReturnData = s.ReturnData[:0]
|
||||
s.Storage = nil
|
||||
s.Err = nil
|
||||
}
|
||||
|
||||
// overrides for gencodec
|
||||
type structLogMarshaling struct {
|
||||
Gas math.HexOrDecimal64
|
||||
|
|
|
|||
Loading…
Reference in a new issue