-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scratchpad #434
base: master
Are you sure you want to change the base?
Scratchpad #434
Conversation
I think it certainly looks simpler without additional free functions |
include/evmc/evmc.h
Outdated
* Also extends the size of the evmc_result to 64 bytes (full cache line). | ||
*/ | ||
uint8_t padding[4]; | ||
union evmc_result_scratchpad scratchpad; |
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.
I think for a 4 byte saving this complicates matters too much for bindings, such as go or rust.
Risks:
A more conservative variant is to place the scratchpad after |
Update version: Still union is used - this is the easiest way to make sure the scratchpad is aligned memory (fix needed for 32-bit arch). However, using unions still might be not ideal for bindings. Alternatively, we can define scratchpad as
|
Added the size tests to Rust too. |
@chfast how about this PR? The current version seems to be good, at least from the C and Rust perspectives. |
Not now. I have some other ideas in this subject. |
The idea behind this is the following: