node
node copied to clipboard
src: zero-initialize data that are copied into the snapshot
This reverts one commit from https://github.com/nodejs/node/pull/50983 because I found a better & simpler approach to prevent the padding from affecting snapshot reproducibility (in the second commit).
Revert "src: make sure that memcpy-ed structs in snapshot have no padding"
This reverts commit 4e58cde589dfd980c8976b158853a331142e1e4b.
src: zero-initialize data that are copied into the snapshot
To prevent padding from making the snapshot unreproducible, zero-initialize the data that are copied into the snapshot so that the padding copied are all zeros. This is better than enlarging the enums to align the fields since it doesn't make the snapshot bigger than necessary, and it removes the need of using static assertions to ensure alignment.
Refs: https://github.com/nodejs/node/pull/50983