Skip to content

Conversation

@jeffro256
Copy link
Contributor

{un}serialize_stl_container_pod_val_as_blob() use aligned memory accesses on potentially unaligned pointers.

@jeffro256 jeffro256 marked this pull request as draft October 14, 2025 20:53
`{un}serialize_stl_container_pod_val_as_blob()` use aligned memory accesses on potentially unaligned pointers.
@jeffro256 jeffro256 force-pushed the align_pod_container_blob branch from 356ae51 to ece0342 Compare October 14, 2025 21:05
@jeffro256 jeffro256 marked this pull request as ready for review October 14, 2025 21:05
@jeffro256
Copy link
Contributor Author

jeffro256 commented Oct 14, 2025

There's potential issues if the operator= for that type did something that wasn't trivial copying of bytes, but I can't assert std::is_trivially_copyable on the value type, without some refactoring, since it's used for crypto::secret_keys in wallet2.

hint_resize(container, count);
for(size_t i = 0; i < count; i++)
container.insert(container.end(), *(pelem++));
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing code was using the copy constructor, and not assignment operator .. ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry, I meant both of them. It uses assignment on the serialization side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants