Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 60bb643

Browse files
committed
Move scratchpad type definition to evmc_result
1 parent 192994d commit 60bb643

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

include/evmc/evmc.h

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -331,24 +331,6 @@ struct evmc_result;
331331
*/
332332
typedef void (*evmc_release_result_fn)(const struct evmc_result* result);
333333

334-
union evmc_result_scratchpad
335-
{
336-
337-
/**
338-
* Reserved data that MAY be used by a evmc_result object creator.
339-
*
340-
* This reserved 4 bytes together with 20 bytes from create_address form
341-
* 24 bytes of memory called "optional data" within evmc_result struct
342-
* to be optionally used by the evmc_result object creator.
343-
*
344-
* @see evmc_result_optional_data, evmc_get_optional_data().
345-
*
346-
* Also extends the size of the evmc_result to 64 bytes (full cache line).
347-
*/
348-
uint8_t bytes[64];
349-
350-
void* pointer;
351-
};
352334

353335
/** The EVM code execution result. */
354336
struct evmc_result
@@ -416,7 +398,23 @@ struct evmc_result
416398
*/
417399
evmc_address create_address;
418400

419-
union evmc_result_scratchpad scratchpad;
401+
union scratchpad
402+
{
403+
/**
404+
* Reserved data that MAY be used by a evmc_result object creator.
405+
*
406+
* This reserved 4 bytes together with 20 bytes from create_address form
407+
* 24 bytes of memory called "optional data" within evmc_result struct
408+
* to be optionally used by the evmc_result object creator.
409+
*
410+
* @see evmc_result_optional_data, evmc_get_optional_data().
411+
*
412+
* Also extends the size of the evmc_result to 64 bytes (full cache line).
413+
*/
414+
uint8_t bytes[32];
415+
416+
void* pointer;
417+
} scratchpad;
420418
};
421419

422420

test/unittests/test_helpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static_assert(sizeof(evmc_call_kind) == sizeof(int),
2222
static_assert(sizeof(evmc_revision) == sizeof(int), "Enum `evmc_revision` is not the size of int");
2323

2424

25-
static_assert(offsetof(evmc_result, scratchpad) % alignof(void*) == 0,
25+
static_assert(offsetof(evmc_result, scratchpad) % 8 == 0,
2626
"evmc_result's scratchpad not properly aligned");
2727

2828
TEST(helpers, release_result)

0 commit comments

Comments
 (0)