-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Rework memory grow/check helpers - pass gas counter by value #598
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #598 +/- ##
===========================================
- Coverage 97.11% 63.09% -34.02%
===========================================
Files 74 36 -38
Lines 7445 2092 -5353
===========================================
- Hits 7230 1320 -5910
- Misses 215 772 +557
Flags with carried forward coverage won't be shown. Click here to find out more.
|
7caf00e
to
d6d8c21
Compare
// Check memory requirements for "copy" instructions. | ||
inline bool check_memory(ExecutionState& state, const uint256& offset, const uint256& size) noexcept | ||
/// Check memory requirements for "copy" instructions. | ||
inline bool check_memory( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the asymmetry between grow_memory
and check_memory
of how gas_left
is used is good. Should probably keep one option, pass-by-reference or return, for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check_memory
is inline
so it does not matter. The grow_memory
is noinline
so calling convention will force int64_t& gas
to be passed via memory.
Thecheck_memory
can be changed too but it has much more users and the changed version wasn't looking very good. So this should be a separate piece of work. Not needed for performance though.
This is preparation to remove
gas
fromExecutionState
and passinggas
by value everywhere.